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
Methods
ShouldWait()
判断是否等待方法
protected virtual bool ShouldWait()
Returns
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取消令牌