Hemanth H.M wrote:
Yes, I'm aware of taskjs.
So it's not a good idea to mix streams and generators!
No, it's important not to think yield from a generator function nested
in another will yield from the *outer* one. That seems to be what you
thought, in all the variations.
Passing a function as a "downward funarg", whether generator or not,
means the callee or whatever code eventually does something with that
funarg may not call it before control returns to the outer function's
activation -- and returns from there.
Thinking about concurrency requires more than generators. Generators
return iterators which can be used synchronously, or not. If you write
async patterns, including callbacks or event listeners set by .on(),
it's up to you to schedule things. This is not a fault of generators, or
of streams (or of event emitters in general).
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss