LatestOperation

StockSharp.Xaml

Runs what a control starts from a place that cannot wait for it - a property setter, say - one run at a time: starting the next run abandons the one in flight, and a failure is handed to the owner.

Implementa: IDisposable

Constructores

LatestOperation
public LatestOperation(Action<Exception> failed)
latestOperation = LatestOperation(failed)

Initializes a new instance of the LatestOperation class.

failed
Receives what a run failed with. An abandoned run is not a failure.

Propiedades

Completion
public Task Completion { get; }
value = latestOperation.Completion

The run started last. It completes when that run has finished, failed or been abandoned, and never faults.

Métodos

Abandon
public void Abandon()
latestOperation.Abandon()

Abandons the run in flight without starting another one.

Dispose
public void Dispose()
latestOperation.Dispose()

Disposes of items in the pool that implement IDisposable.

Start
public void Start(Func<CancellationToken, Task> operation)
latestOperation.Start(operation)

Abandons the run in flight and starts .

operation
The run. Its token is cancelled when a later run replaces it.