TResult
- The type of element signaled.public interface Observer<TResult>
Will receive a call to onSubscribe(Subscription)
on subscription to the Observable
.
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 Observer
instance is capable of handling more.
Modifier and Type | Method | Description |
---|---|---|
void |
onComplete() |
Notifies the Subscriber that the
Observable has finished sending push-based notifications. |
void |
onError(Throwable e) |
Notifies the Observer that the
Observable has experienced an error condition. |
void |
onNext(TResult result) |
Provides the Observer with a new item to observe.
|
void |
onSubscribe(Subscription subscription) |
Invoked on subscription to an
Observable . |
void onSubscribe(Subscription subscription)
Observable
.
No operation will happen 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 MongoIterable
will send notifications only in response to Subscription.request(long)
.
subscription
- Subscription
that allows requesting data via Subscription.request(long)
void onNext(TResult result)
The Observer may call this method 0 or more times.
The Observable
will not call this method again after it calls either onComplete()
or
onError(java.lang.Throwable)
.
result
- the item emitted by the Observable
void onError(Throwable e)
Observable
has experienced an error condition.
If the Observable
calls this method, it will not thereafter call onNext(TResult)
or onComplete()
.
e
- the exception encountered by the Observable
void onComplete()
Observable
has finished sending push-based notifications.
The Observable
will not call this method if it calls onError(java.lang.Throwable)
.