Package me.hsgamer.hscore.task
Class BatchRunnable
java.lang.Object
me.hsgamer.hscore.task.BatchRunnable
- All Implemented Interfaces:
Runnable
A runnable that runs a batch of tasks in sequence
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe task process.static final classThe task pool of theBatchRunnable -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new batch runnable with no initial dataBatchRunnable(Map<String, Object> data) Create a new batch runnable -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTaskPool(int stage, Consumer<BatchRunnable.TaskPool> taskPoolConsumer) Execute the consumer for the task poolgetData()Get the datagetTaskPool(int stage) Get the task poolvoidrun()
-
Constructor Details
-
BatchRunnable
Create a new batch runnable- Parameters:
data- the initial data
-
BatchRunnable
public BatchRunnable()Create a new batch runnable with no initial data
-
-
Method Details
-
run
public void run() -
getTaskPool
Get the task pool- Parameters:
stage- the stage of the task pool- Returns:
- the task pool
-
addTaskPool
Execute the consumer for the task pool- Parameters:
stage- the stage of the task pooltaskPoolConsumer- the consumer
-
getData
Get the data- Returns:
- the data
-