you could add a default callback if the caller just passes null. But if you're gonna make a soap connection I think the async mode is just appropriate
On Nov 19, 2013, at 3:47 AM, Reza Razavipour <reza.razavip...@gmail.com> wrote: > I could then it would get ugly, because now whoever calls getInstance have to > provide a callback. > > If only I could turn the async to a sync call.... > > > On Monday, November 18, 2013 5:43:52 PM UTC-8, Jose wrote: > I guess you can do it in getInstance or init but you're gonna need to pass a > callback to support the async mode > > On Nov 19, 2013, at 3:30 AM, Reza Razavipour <reza.ra...@gmail.com> wrote: > >> Awesome that works wonderfully. Thanks. >> >> One more issue that you have an idea on, is that in getInstance I have to >> make an async call. It creates a soap connection and that is only supported >> in async mode. >> Any thoughts on how to structure that code? >> >> >> >> On Monday, November 18, 2013 3:38:09 PM UTC-8, Reza Razavipour wrote: >> A newbie question... >> >> I have an app that connects and reuses the same connection to a remote >> database and a connection to a remote soap server. >> I want to implement a singleton pattern for each of these. I am used to >> doing that in C++ and Java but want to know what the standard >> implementation for a Singleton pattern is in node.js. >> >> Any recommendations or references. >> >> >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nod...@googlegroups.com >> To unsubscribe from this group, send email to >> nodejs+un...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "nodejs" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to nodejs+un...@googlegroups.com. >> For more options, visit https://groups.google.com/groups/opt_out. > > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to nodejs+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.