Skip to content

IExperimentConcurrencyLimiter

NexusLabs.Foundry.Evaluation

NexusLabs.Foundry.Evaluation.Experiments

IExperimentConcurrencyLimiter Interface

Provides a caller-owned concurrency boundary that can be shared across experiment runs.

public interface IExperimentConcurrencyLimiter

Derived
↳ ExperimentConcurrencyLimiter

Remarks

The runner acquires one lease per execution attempt and disposes the lease before any retry delay. The caller retains ownership of the limiter and its lifetime.

Methods

IExperimentConcurrencyLimiter.AcquireAsync(CancellationToken) Method

Acquires one concurrency lease.

System.Threading.Tasks.ValueTask<System.IAsyncDisposable> AcquireAsync(System.Threading.CancellationToken cancellationToken);

Parameters

cancellationToken System.Threading.CancellationToken

The caller cancellation token.

Returns

System.Threading.Tasks.ValueTask<System.IAsyncDisposable>
A lease that releases the acquired permit when disposed.