CancellationToken::AddCallback (open)

Adds a callback that will be called when this token is cancelled. If the token has been cancelled, the function will be called immediately, and 0 is returned. Signature: MACRO func() or MACRO func(OBJECT cancelexception)

Syntax

LOADLIB "wh::promise.whlib";

INTEGER64 FUNCTION AddCallback(FUNCTION PTR func)

Parameters

FUNCTION PTR func

Function that will be called when the token is cancelled

Return value

INTEGER64

Registration id, 0 if the token was already cancelled