public abstract class Task
extends java.lang.Object
Constructor and Description |
---|
Task() |
Modifier and Type | Method and Description |
---|---|
void |
async(java.util.function.Consumer<GRunnable> task)
Run a task async
|
void |
async(java.util.function.Consumer<GRunnable> task,
java.lang.String time,
boolean repeat)
Schedule a task to run after a specific amount of time, or every period of time.
|
protected abstract void |
async(GRunnable task)
Implementation of running a runnable async
|
protected abstract void |
scheduleAsync(GRunnable task,
sh.okx.timeapi.TimeAPI time,
boolean repeat)
Implementation of scheduling an async runnable
|
void |
shutdown()
Shutdown anything that needs to be shutdown
|
protected abstract void async(GRunnable task)
task
- Runnable to runpublic void async(java.util.function.Consumer<GRunnable> task)
task
- Task to runprotected abstract void scheduleAsync(GRunnable task, sh.okx.timeapi.TimeAPI time, boolean repeat)
task
- Task to runtime
- Time till it runs (or interval)repeat
- Whether the task should be on loop, or only run once.public void async(java.util.function.Consumer<GRunnable> task, java.lang.String time, boolean repeat)
task
- Task to runtime
- Interval or initial delay the task will run at, uses human readable formatting. Available keys are as follows:
repeat
- Whether to looppublic void shutdown()