public interface TaskRunner extends AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_THREADS |
static int |
MIN_THREADS |
| Modifier and Type | Method and Description |
|---|---|
void |
add(TaskDefinition taskDefinition)
Add a task definition to the list of tasks to run.
|
default void |
close()
Alias for stop for use in a try-catch block.
|
String |
getId()
Id of this task runner.
|
boolean |
isStopped()
Returns true if the task runner is stopped and is not accepting any more tasks.
|
Supplier<String> |
report()
Allows for a deferred conversion to a string.
|
void |
stop()
Stop the task runner after waiting for all the threads to finish executing.
|
void |
submit()
Submit the current list of tasks for execution, and block until execution is complete.
|
static final int MIN_THREADS
static final int MAX_THREADS
void add(TaskDefinition taskDefinition) throws Exception
Exceptiondefault void close()
throws Exception
close in interface AutoCloseableExceptionString getId()
boolean isStopped()
Supplier<String> report()
Exceptionvoid stop()
ExecutionException - On an exception.Copyright © 2000-2022 Sualeh Fatehi. All rights reserved.