Skip to main content

Callback class

📖 Description​

The Callback class is used to await the result of an asynchronous operation.

🗃️ Fields​


🏷️ isAlive​

Verifies if the callback pointer is alive and still usable (not fulfilled).

Type​

boolean

▶️ Methods​


🔧 cancel​

Cancels a callback operation.

Signature​

cancel(): boolean

Return value​

Returns true if the callback loop is terminated.


🔧 return​

Fulfills a callback and returns the result of an operation. The type T of the payload is defined by the type of callback.

Signature​

return(payload: T | undefined): T | undefined

Parameters​

NameTypeOptionalDescription
payloadT | undefinedNoSpecifies the return payload for the callback.

Return value​

Returns true if the callback loop is terminated.