VoiceConnectionLimiter
AgentPrism.Core.dllLimits concurrent voice connections per tenant.
public sealed class VoiceConnectionLimiterInheritance
Section titled “Inheritance”object ← VoiceConnectionLimiter
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The counter is in memory and per process. In a multi-instance deployment, each instance applies its own limit, so the aggregate limit scales by the instance count. This is deliberate: voice connections already bind to one instance through sticky sessions, and a distributed counter would require coordination that costs more than the protection provides.
The same reason applies to rate limiting.
Constructors
Section titled “Constructors”VoiceConnectionLimiter(int)
Section titled “ VoiceConnectionLimiter(int)”Initializes a new limiter.
public VoiceConnectionLimiter(int limit)Parameters
Section titled “Parameters”limit int
The maximum concurrent connections per tenant.
Properties
Section titled “Properties”Gets the maximum connections allowed per tenant.
public int Limit { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”CountFor(string)
Section titled “ CountFor(string)”Gets a tenant’s active connection count.
public int CountFor(string tenantId)Parameters
Section titled “Parameters”tenantId string
The tenant.
Returns
Section titled “Returns”The active connection count.
TryAcquire(string)
Section titled “ TryAcquire(string)”Attempts to reserve a connection slot.
public VoiceConnectionLease? TryAcquire(string tenantId)Parameters
Section titled “Parameters”tenantId string
The tenant.
Returns
Section titled “Returns”The reserved slot, or null when the limit is reached. Disposing the returned object releases the slot.
Exceptions
Section titled “Exceptions”tenantId is empty.