Package com.apple.foundationdb.async
Class TaskNotifyingExecutor
java.lang.Object
com.apple.foundationdb.async.TaskNotifyingExecutor
- All Implemented Interfaces:
Executor
An executor that can perform pre- and post- work in the context of the thread executing a task. A typical use for
this executor is to perform actions such as setting up and tearing down thread local variables that need to be
present for code that is executed within the tasks.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Called in the context of an executor thread, immediately after a task has completed execution (either successfully or with error).abstract void
Called in the context of an executor thread, immediately prior to actually executing a task.void
-
Field Details
-
delegate
-
-
Constructor Details
-
TaskNotifyingExecutor
-
-
Method Details
-
execute
-
beforeTask
public abstract void beforeTask()Called in the context of an executor thread, immediately prior to actually executing a task. Exceptions thrown from this method will prevent the execution of the task itself, however theafterTask()
will still be executed. -
afterTask
public abstract void afterTask()Called in the context of an executor thread, immediately after a task has completed execution (either successfully or with error). Exceptions thrown from this will cause the task to be treated as a failure and will mask any exception that the task may have produced.
-