Table of Contents

Class ThrottleDispatcher

Namespace
BootstrapBlazor.Components
Assembly
BootstrapBlazor.dll

限流器泛型类

public class ThrottleDispatcher
Inheritance
ThrottleDispatcher
Inherited Members
Extension Methods

Constructors

ThrottleDispatcher(ThrottleOptions)

限流器泛型类

public ThrottleDispatcher(ThrottleOptions options)

Parameters

options ThrottleOptions

Properties

LastTask

任务实例

protected Task LastTask { get; }

Property Value

Task

Methods

ShouldWait()

判断是否等待方法

protected virtual bool ShouldWait()

Returns

bool

Throttle(Action, CancellationToken)

同步限流方法

public void Throttle(Action action, CancellationToken cancellationToken = default)

Parameters

action Action

同步回调方法

cancellationToken CancellationToken

取消令牌

ThrottleAsync(Func<Task>, CancellationToken)

异步限流方法

public Task ThrottleAsync(Func<Task> function, CancellationToken cancellationToken = default)

Parameters

function Func<Task>

异步回调方法

cancellationToken CancellationToken

取消令牌

Returns

Task