eve.core.cancellation
EVE Cancellation Support
This module provides a @nogc cancellation mechanism based on explicit cancellation tokens and sources. It allows asynchronous operations to be cancelled mid-flight while ensuring that all resources are cleaned up correctly.
enum CancelReason
Types 4
enumCancelReason : ubyte
Reason an operation was terminated.
SUCCESSOperation completed normally.
CANCELLEDOperation was cancelled via a CancelToken.
TIMEOUTOperation timed out.
CLOSEDUnderlying resource was closed.
ERRORSystem error.
structCancelState
Shared state for cancellation tracking.
This struct is intended to be used with CancelSource and CancelToken.
Fields
ubyte cancelledAtomic flag for cancellation (0 = false, 1 = true).structCancelToken
Cancellation token — an opaque, @nogc handle passed to async operations.
When the corresponding source is cancelled, the token's isCancelled property will return true.
Methods
structCancelSource
The owner of a cancellation state.
A source can be used to trigger cancellation and provide tokens to multiple asynchronous operations.
Fields
private CancelState _stateMethods