Interface Task.Context<T>
- Type Parameters:
T
- the type of value produced by aTask
public static interface Task.Context<T>
-
Method Summary
Modifier and TypeMethodDescriptionObtain the unique identity of the executingExecutor
.Obtain the properties of theTask
.Obtains the unique identity of thisTask
.boolean
Determines if aTask
was cancelled.boolean
isDone()
Determines if aTask
completed according to theTaskExecutorService
.boolean
Determines if aTask
execution by anExecutor
resuming after being recovered or due to resumption afterTask.Yield
ing.void
Sets the intermediate result aTask
has produced while being executed by anExecutor
as part of anTask.Orchestration
.
-
Method Details
-
setResult
Sets the intermediate result aTask
has produced while being executed by anExecutor
as part of anTask.Orchestration
.The provided result may be later collected by an
TaskExecutorService
according to the configuredTask.Collector
and then published to registeredTask.Subscriber
s.Multiple calls to this method are permitted during the execution of a
Task
, thus permitting a stream of results to be collected and thus published.- Parameters:
result
- the result
-
isDone
boolean isDone()Determines if aTask
completed according to theTaskExecutorService
.Completion may be due to normal termination, an exception or cancellation. In all of these cases, this method will return
true
.- Returns:
true
if theTask
is considered completedfalse
otherwise
-
isCancelled
boolean isCancelled()Determines if aTask
was cancelled.- Returns:
true
if the task was cancelled- Since:
- 22.06
-
isResuming
boolean isResuming()Determines if aTask
execution by anExecutor
resuming after being recovered or due to resumption afterTask.Yield
ing.- Returns:
true
if theTask
is
-
getProperties
Task.Properties getProperties()Obtain the properties of theTask
.- Returns:
- the task properties
-
getTaskId
String getTaskId()Obtains the unique identity of thisTask
.- Returns:
- the task identity
-
getExecutorId
String getExecutorId()Obtain the unique identity of the executingExecutor
.- Returns:
- the executing
Executor
's identity
-