T - the type of element signaled.public interface Subscriber<T>
onSubscribe(Subscription) once after passing an instance of Subscriber to Publisher.subscribe(Subscriber).
No further notifications will be received until Subscription.request(long) is called.
After signaling demand:
onNext(Object) up to the maximum number defined by Subscription.request(long)onError(Throwable) or onComplete() which signals a terminal state after which no further events will be sent.
Demand can be signaled via Subscription.request(long) whenever the Subscriber instance is capable of handling more.
| Modifier and Type | Method and Description |
|---|---|
void |
onComplete()
Successful terminal state.
|
void |
onError(java.lang.Throwable t)
Failed terminal state.
|
void |
onNext(T t)
Data notification sent by the
Publisher in response to requests to Subscription.request(long). |
void |
onSubscribe(Subscription s)
Invoked after calling
Publisher.subscribe(Subscriber). |
void onSubscribe(Subscription s)
Publisher.subscribe(Subscriber).
No data will start flowing until Subscription.request(long) is invoked.
It is the responsibility of this Subscriber instance to call Subscription.request(long) whenever more data is wanted.
The Publisher will send notifications only in response to Subscription.request(long).
s - Subscription that allows requesting data via Subscription.request(long)void onNext(T t)
Publisher in response to requests to Subscription.request(long).t - the element signaledvoid onError(java.lang.Throwable t)
No further events will be sent even if Subscription.request(long) is invoked again.
t - the throwable signaledvoid onComplete()
No further events will be sent even if Subscription.request(long) is invoked again.