Re: Cancelable promises

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

Received on Saturday, 28 February 2015 06:26:40 UTC