Package me.hsgamer.hscore.task.element
Class TaskPool
java.lang.Object
me.hsgamer.hscore.task.element.TaskPool
The task pool of the
BatchRunnable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd the task to the head of the task pooladdFirst
(Consumer<TaskProcess> task) Add the task to the head of the task poolAdd the task to the tail of the task pooladdLast
(Consumer<TaskProcess> task) Add the task to the tail of the task poolint
getStage()
Get the stage of the task poolpollTask()
Poll the task
-
Constructor Details
-
TaskPool
public TaskPool(int stage) Create a new task pool- Parameters:
stage
- the stage of the task pool
-
-
Method Details
-
addFirst
Add the task to the head of the task pool- Parameters:
task
- the task- Returns:
- the current task pool, for chaining
-
addLast
Add the task to the tail of the task pool- Parameters:
task
- the task- Returns:
- the current task pool, for chaining
-
addFirst
Add the task to the head of the task pool- Parameters:
task
- the task- Returns:
- the current task pool, for chaining
-
addLast
Add the task to the tail of the task pool- Parameters:
task
- the task- Returns:
- the current task pool, for chaining
-
pollTask
Poll the task- Returns:
- the task or null if there is no task
-
getStage
public int getStage()Get the stage of the task pool- Returns:
- the stage
-