public class TaskRunner extends Executable
| Constructor and Description |
|---|
TaskRunner(TaskManager taskManager,
TaskMessenger taskMessenger)
Construct TaskRunner object
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Attempts to cancel execution of this task.
|
Executable |
execute(BackgroundTask backgroundTask)
Executes the worker task.
|
WorkStatus |
getStatus()
Returns task status
|
boolean |
isCancelled()
Returns true if this task was cancelled before it completed normally.
|
waitForTaskpublic TaskRunner(TaskManager taskManager, TaskMessenger taskMessenger)
taskManager - Manages the thread pooltaskMessenger - Post inter-thread messagespublic WorkStatus getStatus()
getStatus in class Executablepublic final Executable execute(BackgroundTask backgroundTask)
backgroundTask - Task to runIllegalStateException - If status is either
WorkStatus.RUNNING or WorkStatus.FINISHED.public final boolean cancel(boolean mayInterruptIfRunning)
mayInterruptIfRunning - true if the thread executing this
task should be interrupted; otherwise, in-progress tasks are allowed
to complete.isCancelled(),
BackgroundTask.onCancelled(Boolean)public final boolean isCancelled()
cancel(boolean)This documentation is licensed by Andrew Bowley under the GPLv3 License.