Esc

cancelled

procedureextensionsince 0.36.1Source
  • macOS: cancelled works on macOS
  • Linux: cancelled works on Linux
  • Windows: cancelled works on Windows
  • Wasm: cancelled works on Wasm

Cooperative cancellation/deadline observation. CPU work must yield to the scheduler and poll; this does not preempt application code. .

Signature

cancelled :: (call: *Call) -> bool
Example
handle :: (call: *Call, data: *void) -> Status {
    while !cancelled(call) {
        // ... a unit of work, then yield to the scheduler ...
        break;
    }

    if cancelled(call) return .{ code = .CANCELLED };
    return .{};
}

See also