Interface Task.SubscribedOrchestration<T>
-
- Type Parameters:
T
- the type of results produced by aTask
- All Known Subinterfaces:
Task.Orchestration<T>
public static interface Task.SubscribedOrchestration<T>
Defines the subset ofTask.Orchestration
methods which are permitted aftersubscribe(Subscriber)
is called. Oncesubscribe(Subscriber)
is called, only two methods are permitted: moresubscribe(Subscriber)
calls, orsubmit()
.- See Also:
Task.Orchestration
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Task.Coordinator<T>
submit()
Submits theTask
for orchestration by theTaskExecutorService
.Task.SubscribedOrchestration<T>
subscribe(Task.Subscriber<? super T> subscriber)
Registers the specifiedTask.Subscriber
as part of the orchestration of theTask
.
-
-
-
Method Detail
-
subscribe
Task.SubscribedOrchestration<T> subscribe(Task.Subscriber<? super T> 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.This method is mutually exclusive to
Task.Orchestration.collect(Collector)
. To subscribe when using aTask.Collector
, useTask.Collectable.subscribe(Subscriber)
on theTask.Collectable
returned byTask.Orchestration.collect(Collector)
.- Parameters:
subscriber
- theTask.Subscriber
- Returns:
- the
Task.Orchestration
to permit fluent-style method chaining - See Also:
Task.Collectable.subscribe(Subscriber)
-
submit
Task.Coordinator<T> submit()
Submits theTask
for orchestration by theTaskExecutorService
.- Returns:
- a
Task.Coordinator
for managing an orchestratedTask
and publishing of collected results toTask.Subscriber
s - See Also:
Task.Collectable.subscribe(Subscriber)
-
-