Interface Observable<TResult>

  • Type Parameters:
    TResult - the type of element signaled.

    Prefer the Reactive Streams-based asynchronous driver (mongodb-driver-reactivestreams artifactId)

    public interface Observable<TResult>
    A Observable represents a MongoDB operation.

    As such it is a provider of a potentially unbounded number of sequenced elements, publishing them according to the demand received from its Observer(s).

    See Also:
    • Method Detail

      • subscribe

        void subscribe​(Observer<? super TResult> observer)
        Request Observable to start streaming data.

        This is a "factory method" and can be called multiple times, each time starting a new Subscription.

        Each Subscription will work for only a single Observer.

        If the Observable rejects the subscription attempt or otherwise fails it will signal the error via Observer.onError(java.lang.Throwable).

        observer - the Observer that will consume signals from this Observable