語言

ConcurrencyLimiter 類別

定義

RateLimiter 協助管理資源的同時存取的實作。

public ref class ConcurrencyLimiter sealed : System::Threading::RateLimiting::RateLimiter
public sealed class ConcurrencyLimiter : System.Threading.RateLimiting.RateLimiter
type ConcurrencyLimiter = class
    inherit RateLimiter
Public NotInheritable Class ConcurrencyLimiter
Inherits RateLimiter
繼承
ConcurrencyLimiter

建構函式

名稱 Description
ConcurrencyLimiter(ConcurrencyLimiterOptions)

初始化 ConcurrencyLimiter

屬性

名稱 Description
IdleDuration

說明所有 RateLimiter 許可證持有的時間長短。 被需要清理未使用的速率限制器的管理員使用。

方法

名稱 Description
AcquireAsync(Int32, CancellationToken)

請等到所需許可證可用或無法取得許可證時再申請。

(繼承來源 RateLimiter)
AcquireAsyncCore(Int32, CancellationToken)

RateLimiter實作中實作的方法。AcquireAsync(Int32, CancellationToken)

(繼承來源 RateLimiter)
AttemptAcquire(Int32)

快速同步嘗試取得許可證。

(繼承來源 RateLimiter)
AttemptAcquireCore(Int32)

RateLimiter實作中實作的方法。AttemptAcquire(Int32)

(繼承來源 RateLimiter)
Dispose()

處理速率限制器。 這會完成任何排隊中的收購,且租約失敗。

(繼承來源 RateLimiter)
Dispose(Boolean)

為實作撰寫的 Dispose 方法。

(繼承來源 RateLimiter)
DisposeAsync()

非同步處理速率限制器。

(繼承來源 RateLimiter)
DisposeAsyncCore()

DisposeAsync 方法用於實作的寫入。

(繼承來源 RateLimiter)
GetStatistics()

如果有統計資料,會取得快照 RateLimiter

擴充方法

名稱 Description
ConfigureAwait(IAsyncDisposable, Boolean)

設定如何執行從異步可處置專案傳回的工作等候。

適用於