W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2015

Re: Cancelable promises

From: Kevin Smith <zenparsing@gmail.com>
Date: Sat, 28 Feb 2015 01:25:36 -0500
Message-ID: <CA+mDt2yS0i9ewds34W4yPCDd7vGdaug6N2fcxjwJmZbHTgs-iw@mail.gmail.com>
To: Ron Buckton <rbuckton@chronicles.org>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>, es-discuss <es-discuss@mozilla.org>
>  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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC