C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetNumberOfPermitsUsed ( ) : int
Release ( ) : void

Releases the acquired semaphore.

TryAcquire ( ) : bool

Tries to acquire the semaphore.

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

Описание методов

GetNumberOfPermitsUsed() публичный Метод

public GetNumberOfPermitsUsed ( ) : int
Результат int

Release() публичный Метод

Releases the acquired semaphore.
public Release ( ) : void
Результат void

TryAcquire() публичный Метод

Tries to acquire the semaphore.
public TryAcquire ( ) : bool
Результат bool

TryableSemaphore() публичный Метод

public TryableSemaphore ( IHystrixProperty numberOfPermits ) : Java.Util.Concurrent.Atomic
numberOfPermits IHystrixProperty
Результат Java.Util.Concurrent.Atomic