Interface Task.Collectable<T,R>
-
- Type Parameters:
T
- the type of theTask
R
- the type of the result
- All Known Subinterfaces:
Task.Completable<T,R>
public static interface Task.Collectable<T,R>
Provides the mechanism to submit, orchestrate and collect results from aTask
defined as part of anTask.Orchestration
, including the creation of aTask.Coordinator
to subscribe to results, manage and interact with an orchestratedTask
.A
Task.Collectable
represents the last part of anTask.Orchestration
definition pipeline.- See Also:
Task.Orchestration
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Task.Completable<T,R>
andThen(Task.CompletionRunnable<? super R> completionRunnable)
Provide a runnable to call when the task has completed.Task.Coordinator<R>
submit()
Submits theTask.Collectable
for orchestration by aTaskExecutorService
.Task.Collectable<T,R>
subscribe(Task.Subscriber<? super R> subscriber)
Registers the specifiedTask.Subscriber
as part of the orchestration of theTask
.Task.Completable<T,R>
until(Remote.Predicate<? super R> predicate)
Sets theRemote.Predicate
to determine when the collection of results will be considered completed, based on the collected result, after which no further results will be published toTask.Subscriber
s.
-
-
-
Method Detail
-
until
Task.Completable<T,R> until(Remote.Predicate<? super R> predicate)
Sets theRemote.Predicate
to determine when the collection of results will be considered completed, based on the collected result, after which no further results will be published toTask.Subscriber
s.When collection activity is completed,
Task.Subscriber
s will then be notified by callingTask.Subscriber.onComplete()
.- Parameters:
predicate
- theRemote.Predicate
to determine when theTask
has completed (based on the collected results) ornull
to indicate continuous collection and publishing of results- Returns:
- a
Task.Collectable
to permit fluent-style method chaining
-
andThen
Task.Completable<T,R> andThen(Task.CompletionRunnable<? super R> completionRunnable)
Provide a runnable to call when the task has completed.- Parameters:
completionRunnable
- theTask.CompletionRunnable
to call when theTask
has completed- Returns:
- a
Task.Collectable
to permit fluent-style method chaining
-
subscribe
Task.Collectable<T,R> subscribe(Task.Subscriber<? super R> subscriber)
Registers the specifiedTask.Subscriber
as part of the orchestration of theTask
.This method may be used multiple times to register multiple
Task.Subscriber
s.- Parameters:
subscriber
- theTask.Subscriber
- Returns:
- the
Task.Collectable
to permit fluent-style method chaining
-
submit
Task.Coordinator<R> submit()
Submits theTask.Collectable
for orchestration by aTaskExecutorService
.- Returns:
- a
Task.Coordinator
for managing an orchestratedTask
and publishing of collected results toTask.Subscriber
s
-
-