Unblocking sleep semantics

Tom Van Cutsem tomvc.be at gmail.com
Wed Jan 18 02:05:51 PST 2012


Another relevant library that makes use of the same generator trick, but
integrated with promises, is Kris Kowal's Q API <
https://github.com/kriskowal/q> via Q.async:

https://github.com/kriskowal/q/blob/master/examples/async-generators/README.md

Event-driven programming without inversion of control, yet without screwing
up your callers' invariants, is cool.

Cheers,
Tom

2012/1/17 Jussi Kalliokoski <jussi.kalliokoski at gmail.com>

> Okay, now that I've been re-reading how generators work and about task.js,
> it has made me realize my error. Yes, you're right, what I've made is
> actually deep continuations, and that's not really what I had in mind.
>
> Thanks everyone, I'll try to think of a better way to do this (or to find
> out if it already exists :] ).
>
> Cheers,
> Jussi
>
>
> On Tue, Jan 17, 2012 at 11:00 PM, Dean Landolt <dean at deanlandolt.com>wrote:
>
>>
>>
>> On Tue, Jan 17, 2012 at 3:54 PM, Jussi Kalliokoski <
>> jussi.kalliokoski at gmail.com> wrote:
>>
>>> Yeah, I was aware of the coroutines in generators, that's why I said it
>>> would be sort of sugar. :)
>>>
>>
>>
>> But it's not sugar, it's a different feature. It's the difference between
>> shallow and deep continuations. We already have shallow continuations (by
>> way of generators). Deep continuations are potentially hazardous. I for one
>> would love some sugar for the shallow continuations use-case of generators
>> but libraries will do just fine.
>>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120118/7b615efa/attachment.html>


More information about the es-discuss mailing list