TaskHandle.cancel

bool cancel() @safe

Request cancellation of the task.

The task will be marked for cancellation and will not be resumed. Note that a running task cannot be interrupted mid-execution.

Returns

true if the task was successfully marked for cancellation.