Interface DelayTaskRegion
public interface DelayTaskRegion
Lightweight controllable delayed task region interface, responsible for operations such as creation, retrieval, cancellation, and counting of lightweight controllable delayed tasks.
- Since:
- 21.16
- Author:
- 渔民小镇
- date:
- 2024-09-01
-
Method Summary
Modifier and TypeMethodDescriptionvoidCancel the execution of the controllable delayed task based on taskId.intcount()Count the number of current delayed tasksof(TaskListener taskListener) Create a controllable delayed task and set the task listener callback.of(String taskId, TaskListener taskListener) Create a controllable delayed task, and set the taskId and task listener callbackGet an Optional controllable delayed task by taskId
-
Method Details
-
optional
-
cancel
Cancel the execution of the controllable delayed task based on taskId.- Parameters:
taskId- taskId
-
count
int count()Count the number of current delayed tasks- Returns:
- the number of current delayed tasks
-
of
Create a controllable delayed task and set the task listener callback.DelayTask delayTask = of(taskListener); // Start the delayed task delayTask.task();- Parameters:
taskListener- task listener callback- Returns:
- the controllable delayed task
-
of
Create a controllable delayed task, and set the taskId and task listener callbackDelayTask delayTask = of(taskId, taskListener); // Start the delayed task delayTask.task();- Parameters:
taskId- taskIdtaskListener- task listener callback- Returns:
- the controllable delayed task
-