public interface TaskScheduler
Modifier and Type | Method and Description |
---|---|
void |
invokeAndWait(Runnable runnable)
Enqueues a task on the scheduler's thread and waits for its completion.
|
void |
invokeLater(Runnable task,
int priority)
Enqueues a task on the scheduler's thread.
|
void |
waitForAll()
Waits for all tasks to finish.
|
void invokeLater(Runnable task, int priority)
task
- the taskpriority
- lower number means higher prioritywaitForAll()
void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException
runnable
- the taskInterruptedException
- if another thread has interrupted the task threadInvocationTargetException
- if an throwable is thrown when running runnable
invokeLater(Runnable, int)
,
waitForAll()
void waitForAll() throws InterruptedException
InterruptedException
- if another thread has interrupted the task threadinvokeLater(Runnable, int)