Interface Task.Context<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getExecutorId()
Obtain the unique identity of the executingExecutor
.Task.Properties
getProperties()
Obtain the properties of theTask
.String
getTaskId()
Obtains the unique identity of thisTask
.boolean
isCancelled()
Determines if aTask
was cancelled.boolean
isDone()
Determines if aTask
completed according to theTaskExecutorService
.boolean
isResuming()
Determines if aTask
execution by anExecutor
resuming after being recovered or due to resumption afterTask.Yield
ing.void
setResult(T result)
Sets the intermediate result aTask
has produced while being executed by anExecutor
as part of anTask.Orchestration
.
-
-
-
Method Detail
-
setResult
void setResult(T result)
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
-
-