T
- the value typepublic final class SerializedSubscriber<T>
extends java.lang.Object
implements org.reactivestreams.Subscriber<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) |
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)
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