T
- the value typepublic final class SerializedSubscriber<T> extends java.lang.Object implements FlowableSubscriber<T>, org.reactivestreams.Subscription
Note that onSubscribe is not serialized in respect of the other methods so make sure the Subscription is set before any of the other methods are called.
The implementation assumes that the actual Subscriber's methods don't throw.
Constructor and Description |
---|
SerializedSubscriber(org.reactivestreams.Subscriber<? super T> actual)
Construct a SerializedSubscriber by wrapping the given actual Subscriber.
|
SerializedSubscriber(org.reactivestreams.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.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
onComplete() |
void |
onError(java.lang.Throwable t) |
void |
onNext(T t) |
void |
onSubscribe(org.reactivestreams.Subscription s)
Implementors of this method should make sure everything that needs
to be visible in
Subscriber.onNext(Object) is established before
calling Subscription.request(long) . |
void |
request(long n) |
public SerializedSubscriber(org.reactivestreams.Subscriber<? super T> actual)
actual
- the actual Subscriber, not null (not verified)public SerializedSubscriber(org.reactivestreams.Subscriber<? super T> actual, boolean delayError)
actual
- the actual Subscriber, not null (not verified)delayError
- if true, errors are emitted after regular values have been emittedpublic void onSubscribe(org.reactivestreams.Subscription s)
FlowableSubscriber
Subscriber.onNext(Object)
is established before
calling Subscription.request(long)
. In practice this means
no initialization should happen after the request()
call and
additional behavior is thread safe in respect to onNext
.
onSubscribe
in interface FlowableSubscriber<T>
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public void onError(java.lang.Throwable t)
onError
in interface org.reactivestreams.Subscriber<T>
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<T>
public void request(long n)
request
in interface org.reactivestreams.Subscription
public void cancel()
cancel
in interface org.reactivestreams.Subscription