Class DelayTaskKit
java.lang.Object
com.iohao.net.common.kit.concurrent.timer.delay.DelayTaskKit
Lightweight controllable delayed task utility class
- Since:
- 21.16
- Author:
- 渔民小镇
- date:
- 2024-09-01
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCancel the task by taskIdstatic DelayTaskRegionLightweight controllable delayed task region interfacestatic voidIf taskId is present, execute the given actionstatic DelayTaskof(TaskListener taskListener) Create a lightweight controllable delayed taskstatic DelayTaskof(String taskId, TaskListener taskListener) Create a lightweight controllable delayed taskget Optional DelayTask by taskIdstatic voidsetDelayTaskRegion(DelayTaskRegion delayTaskRegion) Set the lightweight controllable delayed task region
-
Method Details
-
setDelayTaskRegion
Set the lightweight controllable delayed task region- Parameters:
delayTaskRegion- delayTaskRegion
-
cancel
-
optional
-
ifPresent
-
of
Create a lightweight controllable delayed task- Parameters:
taskListener- task listener callback- Returns:
- lightweight controllable delayed task
-
of
Create a lightweight controllable delayed task- Parameters:
taskId- taskId (If taskId is the same, it will overwrite the previous delayed task)taskListener- task listener callback- Returns:
- lightweight controllable delayed task
-
getDelayTaskRegion
Lightweight controllable delayed task region interface
-