C# 클래스 Polly.Utilities.AsyncSemaphoreExtensions

Contains extension methods for Nito.AsyncEx.AsyncSemaphore
파일 보기 프로젝트 열기: App-vNext/Polly

공개 메소드들

메소드 설명
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.

메소드 상세

Dispose() 공개 정적인 메소드

Disposes of managed resources.
public static Dispose ( this asyncSemaphore ) : void
asyncSemaphore this The instance.
리턴 void

Wait() 공개 정적인 메소드

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).
리턴 bool

WaitAsync() 공개 정적인 메소드

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).
리턴 Task