>
> but, common-node (and maybe some other libraries) have abstracted away 
> that callback when you're living in their abstraction by using fibers under 
> the hood (i'm sure Oleg will pop in any minute to explain how). the way 
> yield is described for generators does not lend itself to ever being 
> abstracted to that degree.
>

Thanks for mentioning Common Node Mikeal. For anyone who wants to check it 
out, here's a link: http://olegp.github.com/common-node/

There's nothing too fancy going on. I've just created synchronous wrappers 
for all modules that do IO. As a result, no code outside my library should 
yield, addressing the interleaving hazard concern that some have expressed. 
In fact, I've been meaning to add a mechanism which detects yields in the 
application code and displays a warning.

I do mean to make a fork of the library which uses generators once they're 
available. The upgrade path should be fairly straightforward with the yield 
keyword added before any method that does IO. However, based on this 
comment http://erik.eae.net/archives/2011/12/29/00.00.29/#comment-104393 it 
looks like generators won't be in Node for another year or so.

Oleg

-- 
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

Reply via email to