public final class

SerializedSubscriber

extends Object
implements FlowableSubscriber<T> Subscription
java.lang.Object
   ↳ io.reactivex.subscribers.SerializedSubscriber<T>

Class Overview

Serializes access to the onNext, onError and onComplete methods of another Subscriber.

Note that onSubscribe(Subscription) is not serialized in respect of the other methods so make sure the onSubscribe is called with a non-null Subscription before any of the other methods are called.

The implementation assumes that the actual Subscriber's methods don't throw.

Summary

Public Constructors
SerializedSubscriber(Subscriber<? super T> actual)
Construct a SerializedSubscriber by wrapping the given actual Subscriber.
SerializedSubscriber(Subscriber<? super T> actual, boolean delayError)
Construct a SerializedSubscriber by wrapping the given actual Observer and optionally delaying the errors till all regular values have been emitted from the internal buffer.
Public Methods
void cancel()
void onComplete()
void onError(Throwable t)
void onNext(T t)
void onSubscribe(Subscription s)
Implementors of this method should make sure everything that needs to be visible in onNext(Object) is established before calling request(long).
void request(long n)
[Expand]
Inherited Methods
From class java.lang.Object
From interface io.reactivex.FlowableSubscriber
From interface org.reactivestreams.Subscriber
From interface org.reactivestreams.Subscription

Public Constructors

public SerializedSubscriber (Subscriber<? super T> actual)

Construct a SerializedSubscriber by wrapping the given actual Subscriber.

Parameters
actual the actual Subscriber, not null (not verified)

public SerializedSubscriber (Subscriber<? super T> actual, boolean delayError)

Construct a SerializedSubscriber by wrapping the given actual Observer and optionally delaying the errors till all regular values have been emitted from the internal buffer.

Parameters
actual the actual Subscriber, not null (not verified)
delayError if true, errors are emitted after regular values have been emitted

Public Methods

public void cancel ()

public void onComplete ()

public void onError (Throwable t)

public void onNext (T t)

public void onSubscribe (Subscription s)

Implementors of this method should make sure everything that needs to be visible in onNext(Object) is established before calling request(long). In practice this means no initialization should happen after the request() call and additional behavior is thread safe in respect to onNext.

public void request (long n)