Package rx.observers

Class SerializedObserver<T>

  • Type Parameters:
    T - the type of items expected to be observed by the Observer
    All Implemented Interfaces:
    Observer<T>

    public class SerializedObserver<T>
    extends java.lang.Object
    implements Observer<T>
    Enforces single-threaded, serialized, ordered execution of onNext(T), onCompleted(), and onError(java.lang.Throwable).

    When multiple threads are emitting and/or notifying they will be serialized by:

    • Allowing only one thread at a time to emit
    • Adding notifications to a queue if another thread is already emitting
    • Not holding any locks or blocking any threads while emitting