Method EnterAsync
EnterAsync(LM, CancellationToken)
Waits until a completion on model may run and returns the lease that
ends its admission when disposed.
Task<IDisposable> EnterAsync(LM model, CancellationToken cancellationToken)
Parameters
modelLMThe model the completion runs on.
cancellationTokenCancellationTokenCancels the wait; the completion is then not run.
Returns
- Task<IDisposable>
The admission lease, disposed exactly once when the completion ends. When it also implements IProgress<T> of int, it is told the number of tokens the completion has generated each time that number grows, on the thread that decodes the completion beside others: keep Report(T) to a few field writes. A lease whose report throws is not told again.