T
- the type of items expected to be observed by the Observer
Port from RxJava's SerializedObserver applied to Reactive Stream
public class SerializedSubscriber<T> extends Object implements org.reactivestreams.Subscription, org.reactivestreams.Subscriber<T>, NonBlocking
onNext(T)
, onComplete()
,
onError(java.lang.Throwable)
, request(long)
and cancel()
.
When multiple threads are emitting and/or notifying they will be serialized by:
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
static <T> SerializedSubscriber<T> |
create(org.reactivestreams.Subscriber<? super T> s) |
org.reactivestreams.Subscriber<? super T> |
delegate() |
long |
getCapacity()
Return defined element capacity, used to drive new
Subscription
request needs. |
boolean |
isReactivePull(Dispatcher dispatcher,
long producerCapacity)
Get the assigned
Dispatcher . |
void |
onComplete() |
void |
onError(Throwable e) |
void |
onNext(T t) |
void |
onSubscribe(org.reactivestreams.Subscription s) |
void |
request(long n) |
String |
toString() |
public static <T> SerializedSubscriber<T> create(org.reactivestreams.Subscriber<? super T> s)
public void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<T>
public void onError(Throwable e)
onError
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
public org.reactivestreams.Subscriber<? super T> delegate()
public boolean isReactivePull(Dispatcher dispatcher, long producerCapacity)
NonBlocking
Dispatcher
.isReactivePull
in interface NonBlocking
public long getCapacity()
NonBlocking
Subscription
request needs. This is the maximum in-flight data allowed to transit to this elements.getCapacity
in interface NonBlocking
Copyright © 2016. All rights reserved.