Package dev.getelements.elements.rt
Interface TaskService
- All Known Implementing Classes:
SimpleTaskService
public interface TaskService
-
Method Summary
Modifier and TypeMethodDescriptionbooleanfinishWithError(TaskId taskId, Throwable error) Fails a task with the suppliedThrowable, indicating an error.booleanfinishWithResult(TaskId taskId, Object result) Finishes a task with the supplied result.voidRegisters a newTaskIdand set of consumers to handle the results.voidstart()Starts theTaskServiceand makes it available to begin accepting tasks.voidstop()Stops theTaskServiceand makes it unavailable to accept tasks.
-
Method Details
-
start
void start()Starts theTaskServiceand makes it available to begin accepting tasks. -
stop
void stop()Stops theTaskServiceand makes it unavailable to accept tasks. Andy pending tasks are completed with an exception and all references cleared. -
register
Registers a newTaskIdand set of consumers to handle the results. -
finishWithResult
Finishes a task with the supplied result. In completing the task, references are immediately cleared and no further messages can be sent to thatTaskId. As not all tasks are registered with a set of listeners, this may simply return false indicating that no listeners were notified. -
finishWithError
Fails a task with the suppliedThrowable, indicating an error. In completing the task, references are immediately cleared and no further messages can be sent to thatTaskId. As not all tasks are registered with a set of listeners, this may simply return false indicating that no listeners were notified.
-