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 TypeMethodDescriptionvoidInvoked by aTask.Coordinatorwhen it is known that no additionalTask.Subscribermethod invocations will occur or has already been terminated by an error.voidInvoked by aTask.Coordinatorwhen an unrecoverable error was encountered, after which no otherTask.Subscribermethods are invoked.voidInvoked when aTask.Coordinatorhas produced an item for consumption.voidonSubscribe(Task.Subscription<? extends T> subscription) Invoked prior to theTask.SubscribermethodsonComplete(),onError(Throwable)andonNext(Object)being invoked for aTask.Subscriptionto aTask.Coordinator.
-
Method Details
-
onComplete
void onComplete()Invoked by aTask.Coordinatorwhen it is known that no additionalTask.Subscribermethod invocations will occur or has already been terminated by an error.After this method is invoked no other
Task.Subscribermethods will be called.If this method throws an exception, the
Task.Subscriberwill be closed. -
onError
Invoked by aTask.Coordinatorwhen an unrecoverable error was encountered, after which no otherTask.Subscribermethods are invoked.If this method throws an exception, the
Task.Subscriberwill be closed.- Parameters:
throwable- the error
-
onNext
Invoked when aTask.Coordinatorhas produced an item for consumption.If this method throws an exception, the
Task.Subscriberwill be closed.- Parameters:
item- the item (possiblynull)
-
onSubscribe
Invoked prior to theTask.SubscribermethodsonComplete(),onError(Throwable)andonNext(Object)being invoked for aTask.Subscriptionto aTask.Coordinator.- Parameters:
subscription- theTask.Subscription
-