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