Interface Task.Context<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetExecutorId()Obtain the unique identity of the executingExecutor.Task.PropertiesgetProperties()Obtain the properties of theTask.StringgetTaskId()Obtains the unique identity of thisTask.booleanisCancelled()Determines if aTaskwas cancelled.booleanisDone()Determines if aTaskcompleted according to theTaskExecutorService.booleanisResuming()Determines if aTaskexecution by anExecutorresuming after being recovered or due to resumption afterTask.Yielding.voidsetResult(T result)Sets the intermediate result aTaskhas produced while being executed by anExecutoras part of anTask.Orchestration.
-
-
-
Method Detail
-
setResult
void setResult(T result)
Sets the intermediate result aTaskhas produced while being executed by anExecutoras part of anTask.Orchestration.The provided result may be later collected by an
TaskExecutorServiceaccording to the configuredTask.Collectorand then published to registeredTask.Subscribers.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 aTaskcompleted 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:
trueif theTaskis considered completedfalseotherwise
-
isCancelled
boolean isCancelled()
Determines if aTaskwas cancelled.- Returns:
trueif the task was cancelled- Since:
- 22.06
-
isResuming
boolean isResuming()
Determines if aTaskexecution by anExecutorresuming after being recovered or due to resumption afterTask.Yielding.- Returns:
trueif theTaskis
-
getProperties
Task.Properties getProperties()
Obtain the properties of theTask.- Returns:
- the task properties
-
-