Even though it's IO, it is very common to require other files during
startup, and therefore ok for it to be a synced operation.
On Tuesday, May 15, 2012 8:49:57 AM UTC-7, Guoliang Cao wrote:
>
> Hi,
>
> I'm new to Node.js and wrapping my head around the asynchronous
> programming model. A question comes to mind is why 'require' itself does
> not use callbacks like below. I believe IO is involved in require and a lot
> of things can fail.
>
> require('http',
> function(http){
> // do stuff with http
> },
> function(error) {
> console.log("Failed to load http");
> });
>
>
> Thanks,
> Guoliang Cao
>
--
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