Table of Contents

Method Cancel

Namespace
SodaFlow.Async
Assembly
SodaFlow.Core.Async.dll

Cancel()

Cancels this tracked item. It is the mechanism of a cancelAll stream and of a cancelMatching stream, and a strategy can use it for its own schedule. For example, SwitchLatest replaces its previous run with it. It operates on an item with the Queued status and on an item with the Running status. The pipeline does not start a Queued item at its turn, and a Running operation stops only if it monitors the CancellationToken that it got. In each condition the item ends as Canceled, thus OnCompleted(TState, AsyncQueuedItem<TInput>, AsyncCompletion, IReadOnlyList<AsyncTrackedItem<TInput>>) runs for it and can start the next operation. A call on an item that ended, on an item that a previous call canceled, or on an item at its end is safe. Those calls do nothing and are not errors, thus a strategy with a stale reference does not monitor the time when an item stops being cancellable.

public void Cancel()