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 aTask.Coordinator
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.void
onError(Throwable throwable)
Invoked by aTask.Coordinator
when an unrecoverable error was encountered, after which no otherTask.Subscriber
methods are invoked.void
onNext(T item)
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 Detail
-
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
void onError(Throwable throwable)
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
void onNext(T item)
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
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
.- Parameters:
subscription
- theTask.Subscription
-
-