C# Class Elders.Hystrix.NET.TryableSemaphore

Semaphore that only supports TryAcquire and never blocks and that supports a dynamic permit count.
Using AtomicInteger increment/decrement instead of java.util.concurrent.Semaphore since we don't need blocking and need a custom implementation to get the dynamic permit count and since AtomicInteger achieves the same behavior and performance without the more complex implementation of the actual Semaphore class using AbstractQueueSynchronizer.
Afficher le fichier Open project: Elders/Hystrix.NET Class Usage Examples

Méthodes publiques

Méthode Description
GetNumberOfPermitsUsed ( ) : int
Release ( ) : void

Releases the acquired semaphore.

TryAcquire ( ) : bool

Tries to acquire the semaphore.

TryableSemaphore ( IHystrixProperty numberOfPermits ) : Java.Util.Concurrent.Atomic

Method Details

GetNumberOfPermitsUsed() public méthode

public GetNumberOfPermitsUsed ( ) : int
Résultat int

Release() public méthode

Releases the acquired semaphore.
public Release ( ) : void
Résultat void

TryAcquire() public méthode

Tries to acquire the semaphore.
public TryAcquire ( ) : bool
Résultat bool

TryableSemaphore() public méthode

public TryableSemaphore ( IHystrixProperty numberOfPermits ) : Java.Util.Concurrent.Atomic
numberOfPermits IHystrixProperty
Résultat Java.Util.Concurrent.Atomic