I was absolutely under that assumption.

Streams allow the event loop to run between iterations, unlike yield,
that's where it gets tricky and converting a stream based logic to task.js
isn't straight forward.







On Sun, Dec 8, 2013 at 11:24 AM, Brendan Eich <[email protected]> wrote:

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



-- 
*'I am what I am because of who we all are'*
h3manth.com <http://www.h3manth.com>
*-- Hemanth HM *
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to