Interface Task<Output>
public interface Task<Output>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <Output> Task<Output> callingWithSpan(Task<Output> task) Produce a copy of this Task that can be stepped independently from this Taskempty()static <Output> Task<Output> static <Output> Task<Output> of(Function<Scheduler, TaskStatus<Output>> f) default voidrelease()Release any transient system resources allocated to this task.spawning(TaskFactory<?> taskFactory) spawning(List<TaskFactory<Any>> tasks) spawningWithSpan(TaskFactory<?> taskFactory) Perform one step of the task, returning the next step of the task and the conditions under which to perform it.
-
Method Details
-
step
Perform one step of the task, returning the next step of the task and the conditions under which to perform it.Clients must only call
step()at most once, and must not invokestep()afterrelease()has been invoked. -
release
default void release()Release any transient system resources allocated to this task.Any system resources held must be released by this method, so that garbage collection can take care of the rest. For instance, if this object makes use of an OS-level Thread, that thread must be explicitly released to avoid resource leaks
This method shall not be called on this object after invoking
#step(Scheduler); nor shallstep(Scheduler)be called after this method. -
duplicate
Produce a copy of this Task that can be stepped independently from this TaskClients must not invoke
duplicate()afterstep(Scheduler)orrelease()has been invoked.- Parameters:
executor- the executor to use for the new Task- Returns:
- a copy of this Task that can be stepped independently from this Task
-
andThen
-
dropOutput
-
calling
-
callingWithSpan
-
delaying
-
emitting
-
spawning
-
spawning
-
spawningWithSpan
-
spawningWithSpan
-
spawning
-
run
- Parameters:
f- Must not yield- Returns:
-
evaluate
-
empty
-
of
-