Method AcquireAsync
AcquireAsync(string, CancellationToken)
Awaits IEdgeHost.EnsureStartedAsync, provisions the model if needed, checks the memory
budget, creates the session on first call, and returns a lease. Concurrent callers for one
model share one session and one in-flight load.
ValueTask<OnnxSessionLease> AcquireAsync(string modelId, CancellationToken cancellationToken = default)
Parameters
modelIdstringThe registered model id.
cancellationTokenCancellationTokenCancellation. Also aborts a CoreML compile in flight.
Returns
- ValueTask<OnnxSessionLease>
A lease that must be disposed.