In the use case specified here... http://nodejs.org/api/modules.html#modules_module_exports we perform some initialization steps when we load the module. In the given example we use setTimeout to ensure that the module is loaded before we emit the event. Is there a way to ensure this synchronization if we have more modules to be required, each emitting an event when loaded.
On Wed, May 16, 2012 at 9:33 AM, Mikeal Rogers <[email protected]>wrote: > Don't dynamically load modules. Load all the modules you might need in the > setup phase, never after. > > On May 15, 2012, at May 15, 20128:55 PM, Mark Hahn wrote: > > > Yeah, don't do that :) > > How else do you dynamically load a module? > > -- > 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 [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > > -- > 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 [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
