IConnectionSemaphoreCollection<TConnection> Interface
Manages a collection of named System.Threading.SemaphoreSlim instances that throttle the number of concurrent connections per connection name.
public interface IConnectionSemaphoreCollection<TConnection> : System.Collections.Generic.IEnumerable<string>, System.Collections.IEnumerableType parameters
Section titled “Type parameters”TConnection
The connection type that the semaphores guard.
Implements System.Collections.Generic.IEnumerable<System.String>, System.Collections.IEnumerable
Remarks
Section titled “Remarks”Enumerating this collection yields the connection names for which a semaphore has been created.
Methods
Section titled “Methods”IConnectionSemaphoreCollection<TConnection>.GetOrCreate(string, int) Method
Section titled “IConnectionSemaphoreCollection<TConnection>.GetOrCreate(string, int) Method”Returns the existing System.Threading.SemaphoreSlim for the given connectionName, or creates a new one allowing up to maxConnections concurrent entries.
System.Threading.SemaphoreSlim GetOrCreate(string connectionName, int maxConnections);Parameters
Section titled “Parameters”connectionName System.String
The logical name identifying the connection whose semaphore is requested.
maxConnections System.Int32
The maximum number of concurrent connections the semaphore should allow if a new one is created.
Returns
Section titled “Returns”System.Threading.SemaphoreSlim
A System.Threading.SemaphoreSlim that limits concurrent access for the specified connection name.