Interface Task.Subscriber<T>
- Type Parameters:
T
- the type of result received
- All Known Implementing Classes:
RecordingSubscriber
,SystemOutSubscriber
public static interface Task.Subscriber<T>
A receiver of items produced by a
Task.Coordinator
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked by aTask.Coordinator
when it is known that no additionalTask.Subscriber
method invocations will occur or has already been terminated by an error.void
Invoked by aTask.Coordinator
when an unrecoverable error was encountered, after which no otherTask.Subscriber
methods are invoked.void
Invoked when aTask.Coordinator
has produced an item for consumption.void
onSubscribe
(Task.Subscription<? extends T> subscription) Invoked prior to theTask.Subscriber
methodsonComplete()
,onError(Throwable)
andonNext(Object)
being invoked for aTask.Subscription
to aTask.Coordinator
.
-
Method Details
-
onComplete
void onComplete()Invoked by aTask.Coordinator
when it is known that no additionalTask.Subscriber
method invocations will occur or has already been terminated by an error.After this method is invoked no other
Task.Subscriber
methods will be called.If this method throws an exception, the
Task.Subscriber
will be closed. -
onError
Invoked by aTask.Coordinator
when an unrecoverable error was encountered, after which no otherTask.Subscriber
methods are invoked.If this method throws an exception, the
Task.Subscriber
will be closed.- Parameters:
throwable
- the error
-
onNext
Invoked when aTask.Coordinator
has produced an item for consumption.If this method throws an exception, the
Task.Subscriber
will be closed.- Parameters:
item
- the item (possiblynull
)
-
onSubscribe
Invoked prior to theTask.Subscriber
methodsonComplete()
,onError(Throwable)
andonNext(Object)
being invoked for aTask.Subscription
to aTask.Coordinator
.- Parameters:
subscription
- theTask.Subscription
-