java.lang.Object
org.miaixz.bus.socket.metric.HashedWheelTimer
- All Implemented Interfaces:
Runnable,SocketTimer
哈希计时器
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHashedWheelTimer(ThreadFactory threadFactory) HashedWheelTimer(ThreadFactory threadFactory, long tickDuration, int ticksPerWheel) -
Method Summary
Modifier and TypeMethodDescriptionlongvoidrun()scheduleWithFixedDelay(Runnable runnable, long delay, TimeUnit unit) voidshutdown()
-
Field Details
-
DEFAULT_TIMER
-
-
Constructor Details
-
HashedWheelTimer
-
HashedWheelTimer
- Parameters:
threadFactory-tickDuration- 波动周期,单位:毫秒ticksPerWheel- 时间轮大小,自适应成 2^n
-
-
Method Details
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceSocketTimer
-
scheduleWithFixedDelay
- Specified by:
scheduleWithFixedDelayin interfaceSocketTimer
-
schedule
- Specified by:
schedulein interfaceSocketTimer
-
pendingTimeouts
public long pendingTimeouts() -
run
public void run()
-