Interface Scheduler<T>
- All Known Implementing Classes:
ControlledWorkerScheduler
public interface Scheduler<T>
Interface for any scheduler.
- Author:
- Andreas Schwarte
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort the execution of running and queued tasks.voiddone()Inform the scheduler that a certain task is done.voidhandleResult(CloseableIteration<T> res) Callback to handle the result.voidInform the scheduler that no more tasks will be scheduled.booleanDetermine if the scheduler has unfinished tasks.voidschedule(ParallelTask<T> task) Schedule the provided task.voidshutdown()voidToss an exception to the scheduler.
-
Method Details
-
schedule
Schedule the provided task.- Parameters:
task-
-
handleResult
Callback to handle the result.- Parameters:
res-
-
done
void done()Inform the scheduler that a certain task is done. -
toss
Toss an exception to the scheduler.- Parameters:
e-
-
abort
void abort()Abort the execution of running and queued tasks. -
shutdown
void shutdown() -
informFinish
void informFinish()Inform the scheduler that no more tasks will be scheduled. -
isRunning
boolean isRunning()Determine if the scheduler has unfinished tasks.- Returns:
- whether the scheduler is running
-