Token for cancelling long-running orchestration operations. Thread-safe and can be checked from any thread.
Attributes
Note
For operations with many nodes, use cachedCancellationFuture instead of cancellationFuture to avoid callback accumulation.
Example
val token = CancellationToken()
val runner = PlanRunner()
val result = runner.execute(plan, inputs, token)
// Cancel from another thread
token.cancel()
Create a Future that fails with CancellationException when cancelled. Note: For long-running operations with many nodes, consider caching this future to avoid accumulating callbacks.
Create a Future that fails with CancellationException when cancelled. Note: For long-running operations with many nodes, consider caching this future to avoid accumulating callbacks.