Interface Observer<TResult>
-
- Type Parameters:
TResult- The type of element signaled.
Deprecated.Prefer the Reactive Streams-based asynchronous driver (mongodb-driver-reactivestreams artifactId)
@Deprecated public interface Observer<TResult>
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 theObserverinstance is capable of handling more.- Since:
- 3.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidonComplete()Deprecated.Notifies the Subscriber that theObservablehas finished sending push-based notifications.voidonError(Throwable e)Deprecated.Notifies the Observer that theObservablehas experienced an error condition.voidonNext(TResult result)Deprecated.Provides the Observer with a new item to observe.voidonSubscribe(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
MongoIterablewill send notifications only in response toSubscription.request(long).- Parameters:
subscription-Subscriptionthat 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
Observablewill 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 theObservablehas experienced an error condition.If the
Observablecalls this method, it will not thereafter callonNext(TResult)oronComplete().- Parameters:
e- the exception encountered by theObservable
-
onComplete
void onComplete()
Deprecated.Notifies the Subscriber that theObservablehas finished sending push-based notifications.The
Observablewill not call this method if it callsonError(java.lang.Throwable).
-
-