Class AbstractTask<T>
java.lang.Object
dev.upcraft.sparkweave.impl.scheduler.AbstractTask<T>
- All Implemented Interfaces:
Task<T>
- Direct Known Subclasses:
RepeatingTask,SingleRunTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel any future execution of this task.booleanlongabstract booleanrun(LongSupplier timeSupplier)
-
Field Details
-
task
-
nextExecutionTime
protected long nextExecutionTime
-
-
Constructor Details
-
AbstractTask
-
-
Method Details
-
nextExecutionTime
public long nextExecutionTime() -
run
-
getLastResult
- Specified by:
getLastResultin interfaceTask<T>- Returns:
- the last result of this task, or an exception if the task failed.
-
cancel
public void cancel()Description copied from interface:TaskCancel any future execution of this task. If the task is currently running, it will be allowed to finish.Repeatedly calling this method has no effect.
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceTask<T>
-