This proposal specifies how cancellation is triggered and handled in a Promises/A+ library. Cancellation support is optional and provides a mechanism for a promise consumer to signal that further work on fulfilling should be stopped. Cancellation is modeled as rejection with a specified "Cancel" Error signature.
In addition to the terminology from Promises/A+ we use the following:
CancelException
is an error used to reject cancelled promises.- "direct cancellation" is what occurs when a pending promise is cancelled by the consumer of a promise by calling
cancel