Class ConcurrencyLimitOptions
- Namespace
- Kevlar
- Assembly
- Kevlar.dll
Configuration for a concurrency limit (concurrency limiter) strategy: at most MaxConcurrency executions run at once, with up to QueueLimit more waiting; anything beyond that is rejected immediately.
public sealed class ConcurrencyLimitOptions
- Inheritance
-
ConcurrencyLimitOptions
- Inherited Members
Remarks
When an execution is rejected, rejection metrics are recorded and OnRejected runs and is awaited. Callback failures are reported through OnCallbackError and do not replace the rejection.
Constructors
ConcurrencyLimitOptions()
public ConcurrencyLimitOptions()
Properties
MaxConcurrency
Maximum concurrent executions. Default 10.
public int MaxConcurrency { get; set; }
Property Value
Name
An optional low-cardinality name used by strategy telemetry.
public string? Name { get; set; }
Property Value
OnRejected
Invoked and awaited when an execution is rejected. Return default from a synchronous callback.
public Func<ConcurrencyLimitRejectedEvent, ValueTask>? OnRejected { get; set; }
Property Value
QueueLimit
Maximum executions allowed to wait for a slot. Default 0 (reject immediately when full). The queue has no built-in timeout; compose a timeout outside this strategy to bound the wait.
public int QueueLimit { get; set; }