Table of Contents

Method EnterAsync

Namespace
LMKit.Inference
Assembly
LM-Kit.NET.dll

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

model LM

The model the completion runs on.

cancellationToken CancellationToken

Cancels 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.

Share