Trait

org.mongodb.scala

Observer

Related Doc: package scala

Permalink

trait Observer[T] extends com.mongodb.async.client.Observer[T]

A Scala based wrapper of the Observer interface which provides a mechanism for receiving push-based notifications.

Will receive a call to Observer.onSubscribe(subscription: Subscription) on subscription to the Observable.

Default implementations of this trait are greedy and will call Subscription.request with Long.MaxValue so that all results are requested. Custom implementations of the onSubscribe method can be used to control "back-pressure" and ensure that only demand that the Observer is capable of handling is requested.

After signaling demand:

- One or more invocations of Observer.onNext up to the maximum number defined by Subscription.request - Single invocation of Observer.onError or Observer.onComplete which signals a terminal state after which no further events will be sent.

T

The type of element signaled.

Linear Supertypes
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Observer
  2. Observer
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def onComplete(): Unit

    Permalink

    Notifies the Subscriber that the Observable has finished sending push-based notifications.

    Notifies the Subscriber that the Observable has finished sending push-based notifications.

    The Observable will not call this method if it calls onError.

    Definition Classes
    Observer → Observer
  2. abstract def onError(e: Throwable): Unit

    Permalink

    Notifies the Observer that the Observable has experienced an error condition.

    Notifies the Observer that the Observable has experienced an error condition.

    If the Observable calls this method, it will not thereafter call onNext or onComplete.

    e

    the exception encountered by the Observable

    Definition Classes
    Observer → Observer
  3. abstract def onNext(result: T): Unit

    Permalink

    Provides the Observer with a new item to observe.

    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 either onComplete or onError.

    result

    the item emitted by the Observable

    Definition Classes
    Observer → Observer

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def onSubscribe(subscription: com.mongodb.async.client.Subscription): Unit

    Permalink

    Handles the automatic boxing of a Java subscription so it conforms to the interface.

    Handles the automatic boxing of a Java subscription so it conforms to the interface.

    subscription

    the Java subscription

    Definition Classes
    Observer → Observer
    Note

    Users should not have to implement this method but rather use the Scala Subscription.

  16. def onSubscribe(subscription: Subscription): Unit

    Permalink

    Invoked on subscription to an Observable.

    Invoked on subscription to an Observable.

    No operation will happen until Subscription.request is invoked.

    It is the responsibility of this Subscriber instance to call Subscription.request whenever more data is wanted.

    subscription

    Subscription that allows requesting data via Subscription.request

  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped