一款简单易用的基础网络通讯组件库。

FlowGate 类

流量控制器。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
C#
public class FlowGate : Counter
Inheritance
Object    Counter    FlowGate

构造函数

FlowGate初始化 FlowGate 类的一个新实例

属性

Count 周期内的累计计数值。
(继承自 Counter。)
LastIncrement 最后一次递增时间
(继承自 Counter。)
Maximum 最大值
MaximumWaitTime 最长休眠周期。默认为5s.

当设置为5s时,假如设置的Maximum=10,而一次递增了100,则理应会休眠10s,但是会休眠5s。反之,如果设置1,则每秒周期都会清空。

OnPeriod 当达到一个周期时触发。
(继承自 Counter。)
Period 计数周期。默认1秒。
(继承自 Counter。)

方法

AddCheckWait 检测等待
AddCheckWaitAsync 异步添加并检查等待
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
Increment 累计增加一个计数
(继承自 Counter。)
Increment(Int64) 累计增加计数
(继承自 Counter。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
Reset 重置CountLastIncrement
(继承自 Counter。)
ToStringReturns a string that represents the current object.
(继承自 Object。)

字段

m_count 周期内的累计计数值。
(继承自 Counter。)
m_lastIncrement 最后一次递增时间
(继承自 Counter。)

扩展方法

Map
(由 Mapper 定义。)
Map
(由 Mapper 定义。)
MapTTarget
(由 Mapper 定义。)
ToJsonString 转换为Json
(由 SerializeConvert 定义。)

参见