Cancelable promises

Kevin Smith zenparsing at gmail.com
Fri Feb 27 22:25:36 PST 2015


>  AsyncJS (http://github.com/rbuckton/asyncjs) uses a separate abstraction
> for cancellation based on the .NET
> CancellationTokenSource/CancellationToken types. You can find more
> information about this abstraction in the MSDN documentation here:
> https://msdn.microsoft.com/en-us/library/dd997364(v=vs.110).aspx
>

That's what I was looking for : )

So the core idea is that the initiator establishes a one-way communication
channel through which it can send control signals to the in-flight task.
The task can choose to respond to those signals in whatever fashion it
likes (or not at all).

That design seems far cleaner than adding functionality directly to
promises, but can it be made JS-ergonomic?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150228/82f5f9c6/attachment.html>


More information about the es-discuss mailing list