Interface Observer<TResult>
-
- Type Parameters:
TResult
- The type of element signaled.
@Deprecated public interface Observer<TResult>
Deprecated.Prefer the Reactive Streams-based asynchronous driver (mongodb-driver-reactivestreams artifactId)Provides a mechanism for receiving push-based notifications.Will receive a call to
onSubscribe(Subscription)
on subscription to theObservable
. No further notifications will be received untilSubscription.request(long)
is called.After signaling demand:
- One or more invocations of
onNext(Object)
up to the maximum number defined bySubscription.request(long)
- Single invocation of
onError(Throwable)
oronComplete()
which signals a terminal state after which no further events will be sent.
Demand can be signaled via
Subscription.request(long)
whenever theObserver
instance is capable of handling more.- Since:
- 3.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
onComplete()
Deprecated.Notifies the Subscriber that theObservable
has finished sending push-based notifications.void
onError(Throwable e)
Deprecated.Notifies the Observer that theObservable
has experienced an error condition.void
onNext(TResult result)
Deprecated.Provides the Observer with a new item to observe.void
onSubscribe(Subscription subscription)
Deprecated.Invoked on subscription to anObservable
.
-
-
-
Method Detail
-
onSubscribe
void onSubscribe(Subscription subscription)
Deprecated.Invoked on subscription to anObservable
.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 toSubscription.request(long)
.- Parameters:
subscription
-Subscription
that allows requesting data viaSubscription.request(long)
-
onNext
void onNext(TResult result)
Deprecated.Provides the Observer with a new item to observe.The Observer may call this method 0 or more times.
The
Observable
will not call this method again after it calls eitheronComplete()
oronError(java.lang.Throwable)
.- Parameters:
result
- the item emitted by theObservable
-
onError
void onError(Throwable e)
Deprecated.Notifies the Observer that theObservable
has experienced an error condition.If the
Observable
calls this method, it will not thereafter callonNext(TResult)
oronComplete()
.- Parameters:
e
- the exception encountered by theObservable
-
onComplete
void onComplete()
Deprecated.Notifies the Subscriber that theObservable
has finished sending push-based notifications.The
Observable
will not call this method if it callsonError(java.lang.Throwable)
.
-
-