Enable async/await to work on functions that don't just return promises.

Florian Bösch pyalot at gmail.com
Sun Feb 26 14:00:43 UTC 2017


On Sun, Feb 26, 2017 at 2:51 PM, Codefined <codefined at debenclipper.com>
wrote:

> What I feel we need is some way of making an asynchronous function
> "appear" to be synchronous.
>
That's what co-routines are. Best practices for co-routines is usually to
have some sort of API to spawn them (like new Routine(somefunction)), to be
able to switch to them (like someroutine.switch(funargs)) and to throw
exceptions into them (like someroutine.throw(error)) as well as a way to
obtain the currently used routine (like Routine.current).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170226/9ecc5d8b/attachment.html>


More information about the es-discuss mailing list