CancellationTokenSource (open)
A CancellationTokenSource generates a CancellationToken. Cancellation of that token is done on this class.
Syntax
LOADLIB "wh::promise.whlib";
OBJECTTYPE CancellationTokenSource
Constructor
- MACRO NEW()
Constructs a new CancellationTokenSource
Properties
- PROPERTY cancelexception
If cancelled, cancel exception object
- PROPERTY canceltoken
Cancellation token
Functions
- MACRO Cancel()
Cancels the token with a OperationCancelledException exception
- MACRO CancelWithException(OBJECT e)
Cancels the token with a specific exception
- MACRO LinkToken(OBJECT token)
Executes a cancel when the passed token is cancelled