W.l.o.g we assume that all native cancellable activities are exposed to the JavasScript in the following form:
function doIt(
options: any,
cb: (error: any, result: ResultType) => void
): CancellationHandle {
[native code]
}
function cancelIt(ch: CancellationHandle): void {
[native code]
}
where activity can be in one of three distinct states:
- running - means that the
- finished
- cancelled
We call such activities as primary or atomic cancellable activies.