語言

FixedWindowRateLimiter 類別

定義

RateLimiter 實作中,更新允許在某個視窗內定期獲得許可。

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

建構函式

名稱 Description
FixedWindowRateLimiter(FixedWindowRateLimiterOptions)

初始化 FixedWindowRateLimiter

屬性

名稱 Description
IdleDuration

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

IsAutoReplenishing

指定是否 ReplenishingRateLimiter 自動補充其標記,或期望外部來源定期呼叫 TryReplenish()

ReplenishmentPeriod

指定 Will 補充代幣的頻率 ReplenishingRateLimiter 。 如果 IsAutoReplenishing 是, false 那就是應該打電話的頻率 TryReplenish()

方法

名稱 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

TryReplenish()

嘗試在視窗中補充請求計數器。

擴充方法

名稱 Description
ConfigureAwait(IAsyncDisposable, Boolean)

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

適用於