This module provides a tree-structured cancellation context called CancellationToken where cancelling a parent
automatically cancels all child contexts.
A cancellation context that allows multiple consumers to wait until cancellation is requested. Forms a tree structure where cancelling a parent cancels all children.
- token : CancellationToken
- id : UInt64
Instances For
Creates a new root cancellation context.
Equations
Instances For
Forks a child context from a parent. If the parent is already cancelled, returns the parent context. Otherwise, creates a new child that will be cancelled when the parent is cancelled.
Equations
Instances For
Cancels this context and all child contexts with the given reason.
Equations
Instances For
Checks if the context is cancelled.
Equations
Instances For
Returns the cancellation reason if the context is cancelled.
Equations
Instances For
Waits for cancellation. Returns a task that completes when the context is cancelled.
Equations
Instances For
Creates a selector that waits for cancellation.
Equations
Instances For
Counts the number of alive (non-cancelled) tokens in the context tree, including this context and all its descendants.