C# Class Polly.Utilities.AsyncSemaphoreExtensions

Contains extension methods for Nito.AsyncEx.AsyncSemaphore
Afficher le fichier Open project: App-vNext/Polly

Méthodes publiques

Méthode Description
Dispose ( this asyncSemaphore ) : void

Disposes of managed resources.

Wait ( this asyncSemaphore, System.TimeSpan timeSpan, CancellationToken cancellationToken ) : bool

Synchronously waits for a slot in the semaphore to be available. This method may block the calling thread.

WaitAsync ( this asyncSemaphore, System.TimeSpan timeSpan, CancellationToken cancellationToken ) : Task

Asynchronously waits for a slot in the semaphore to be available. This method may block the calling thread.

Method Details

Dispose() public static méthode

Disposes of managed resources.
public static Dispose ( this asyncSemaphore ) : void
asyncSemaphore this The instance.
Résultat void

Wait() public static méthode

Synchronously waits for a slot in the semaphore to be available. This method may block the calling thread.
public static Wait ( this asyncSemaphore, System.TimeSpan timeSpan, CancellationToken cancellationToken ) : bool
asyncSemaphore this The instance.
timeSpan System.TimeSpan A TimeSpan for which to wait. In this implementation, only TimeSpan.Zero is permitted, indicating that an attempt should be made to obtain the semaphore immediately, without further waiting. The implementation is intentionally limited to only what is needed to support Polly's use of the corresponding overload in System.Threading.Tasks.SemaphoreSlim version later than .NET 4.0..
cancellationToken System.Threading.CancellationToken The cancellation token used to cancel the wait. If this is already set, then this method will attempt to take the slot immediately (succeeding if a slot is currently available).
Résultat bool

WaitAsync() public static méthode

Asynchronously waits for a slot in the semaphore to be available. This method may block the calling thread.
public static WaitAsync ( this asyncSemaphore, System.TimeSpan timeSpan, CancellationToken cancellationToken ) : Task
asyncSemaphore this The instance.
timeSpan System.TimeSpan A TimeSpan for which to wait. In this implementation, only TimeSpan.Zero is permitted, indicating that an attempt should be made to obtain the semaphore immediately, without further waiting. The implementation is intentionally limited to only what is needed to support Polly's use of the corresponding overload in System.Threading.Tasks.SemaphoreSlim version later than .NET 4.0..
cancellationToken System.Threading.CancellationToken The cancellation token used to cancel the wait. If this is already set, then this method will attempt to take the slot immediately (succeeding if a slot is currently available).
Résultat Task