Coordinates cancellation for several waits and promises.
One instance is a one-way lifecycle. After cancel runs,
Cancelable.isCanceled stays true; create a new instance for later
work. Cancellation rejects registered operations with CancelError.
It does not stop the underlying work of a promise passed to guard.
Returns whether cancel has been called.
Cancels registered operations and clears their delay timers.
Calling this method more than once is safe.
Waits for a duration or rejects with CancelError after cancellation.
The timer does not keep a Node.js process alive.
Coordinates cancellation for several waits and promises.
One instance is a one-way lifecycle. After cancel runs, Cancelable.isCanceled stays
true; create a new instance for later work. Cancellation rejects registered operations with CancelError. It does not stop the underlying work of a promise passed to guard.Example