On Sat, Jan 24, 2015 at 5:25 PM, Maverick Peppers <[email protected]>
wrote:
> while(buffer == 0) {}
>
The above line does not mean wait around 'awhile', it means "run forever,
not giving anyone else any CPU time to do anything or *respond* to
anything". You are not 'cooperating' with Node or anyone else.
There are a number of ways/ideas to say "let me wait around until the
system/Node can respond", but this would be one replacement for the above
line:
while ( buffer == 0 )
process.nextTick();
With that you are saying "let me check on something fairly often, but if it
hasn't happened yet, give me control to the system/Node so it can do
'whatever' needs to be done".
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/CAEfS-pjT4XFNeYFe3X3rz9wjkAt_QHw%3DyN8di8zQTHU5G1jHfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.