It seems to me that `yield` instructions block the same way that `wait` blocks with thread or processes. async/wait is more or less threading (cooperative threading).
On Thursday, 24 April 2014 05:00:58 UTC+2, Tim Caswell wrote: > > Ravi, I don't think it's misleading to say that something blocks a thread > or blocks a generator or blocks a function. To me, all blocking means is > that the logic can't continue till the thing has finished. A non-blocking > function will return immediately and let you run other code while waiting > for the result. > > So to me, a yield in a generator that suspends the generator till some > non-blocking operation is complete is "blocking" in the context of the > generator function, but not blocking for the entire process. The single > threaded node server can still handle and process other requests. > > Though I could see how saying "this yield blocks on the non-blocking > function" would confuse someone. > > > > On Sat, Apr 19, 2014 at 7:50 PM, // ravi <ravi-...@g8o.net > <javascript:>>wrote: > >> On Apr 19, 2014, at 1:02 PM, Tim Caswell <t...@creationix.com<javascript:>> >> wrote: >> >> I would like to bring some experience and history to this conversation. >> >> >> >> Great post Tim, thank you for giving us a glimpse of the past. >> >> Re: your closing comment, I too was going to suggest use of >> blocking/non-blocking earlier in this thread (and in fact, I sort of >> adopted such a usage, myself, in my earlier comment), but on second >> thought, I think it is equally misleading (at least to me). Whether a call >> is blocking or non-blocking often depends on how it is used (such as I/O >> system calls which leave it to the caller to decide whether to block or >> not). Of course I realise we are speaking of node module calls not system >> calls. >> >> Regards, >> >> —ravi >> >> -- >> -- >> 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<javascript:> >> To unsubscribe from this group, send email to >> nodejs+un...@googlegroups.com <javascript:> >> 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 <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- -- 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/d/optout.