Top Description Fields Constructors Methods
io.reactivex.processors

pack-priv final Class SerializedProcessor<T>

extends FlowableProcessor<T>
Class Inheritance
Type Parameters
<T>
the item value type
Imports
io.reactivex.annotations.Nullable, org.reactivestreams.*, io.reactivex.internal.util.*, io.reactivex.plugins.RxJavaPlugins

Serializes calls to the Subscriber methods.

All other Publisher and Subject methods are thread-safe by design.

Field Summary

Modifier and TypeField and Description
pack-priv final FlowableProcessor<T>
actual

The actual subscriber to serialize Subscriber calls to.

pack-priv volatile boolean
done

Indicates a terminal event has been received and all further events will be dropped.

pack-priv boolean
emitting

Indicates an emission is going on, guarded by this.

pack-priv AppendOnlyLinkedArrayList<Object>
queue

If not null, it holds the missed NotificationLite events.

Constructor Summary

AccessConstructor and Description
pack-priv
SerializedProcessor(final FlowableProcessor<T>
the subject wrapped
actual
)

Constructor that wraps an actual subject.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
emitLoop()

Loops until all notifications in the queue has been processed.

public Throwable
getThrowable()

Implements abstract io.reactivex.processors.FlowableProcessor.getThrowable.

Returns the error that caused the FlowableProcessor to terminate or null if the FlowableProcessor hasn't terminated yet.
public boolean
hasComplete()

Implements abstract io.reactivex.processors.FlowableProcessor.hasComplete.

Returns true if the FlowableProcessor has reached a terminal state through a complete event.
public boolean
hasSubscribers()

Implements abstract io.reactivex.processors.FlowableProcessor.hasSubscribers.

Returns true if the FlowableProcessor has subscribers.
public boolean
hasThrowable()

Implements abstract io.reactivex.processors.FlowableProcessor.hasThrowable.

Returns true if the FlowableProcessor has reached a terminal state through an error event.
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public void
onNext(T
the element signaled
t
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public void
onSubscribe(Subscription
the Subscription that allows requesting data via Subscription#request(long)
s
)

Implements org.reactivestreams.Subscriber.onSubscribe, io.reactivex.FlowableSubscriber.onSubscribe.

Implementors of this method should make sure everything that needs to be visible in onNext(Object) is established before calling Subscription#request(long).
protected void
subscribeActual(Subscriber<? super T>
the incoming Subscriber, never null
s
)

Implements abstract io.reactivex.Flowable.subscribeActual.

Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Subscribers.
Inherited from io.reactivex.processors.FlowableProcessor:
toSerialized

Field Detail

actualback to summary
pack-priv final FlowableProcessor<T> actual

The actual subscriber to serialize Subscriber calls to.

doneback to summary
pack-priv volatile boolean done

Indicates a terminal event has been received and all further events will be dropped.

emittingback to summary
pack-priv boolean emitting

Indicates an emission is going on, guarded by this.

queueback to summary
pack-priv AppendOnlyLinkedArrayList<Object> queue

If not null, it holds the missed NotificationLite events.

Constructor Detail

SerializedProcessorback to summary
pack-priv SerializedProcessor(final FlowableProcessor<T> actual)

Constructor that wraps an actual subject.

Parameters
actual:FlowableProcessor<T>

the subject wrapped

Method Detail

emitLoopback to summary
pack-priv void emitLoop()

Loops until all notifications in the queue has been processed.

getThrowableback to summary
public Throwable getThrowable()

Implements abstract io.reactivex.processors.FlowableProcessor.getThrowable.

Doc from io.reactivex.processors.FlowableProcessor.getThrowable.

Returns the error that caused the FlowableProcessor to terminate or null if the FlowableProcessor hasn't terminated yet.

The method is thread-safe.

Returns:Throwable

the error that caused the FlowableProcessor to terminate or null if the FlowableProcessor hasn't terminated yet

Annotations
@Override
@Nullable
hasCompleteback to summary
public boolean hasComplete()

Implements abstract io.reactivex.processors.FlowableProcessor.hasComplete.

Doc from io.reactivex.processors.FlowableProcessor.hasComplete.

Returns true if the FlowableProcessor has reached a terminal state through a complete event.

The method is thread-safe.

Returns:boolean

true if the FlowableProcessor has reached a terminal state through a complete event

Annotations
@Override
hasSubscribersback to summary
public boolean hasSubscribers()

Implements abstract io.reactivex.processors.FlowableProcessor.hasSubscribers.

Doc from io.reactivex.processors.FlowableProcessor.hasSubscribers.

Returns true if the FlowableProcessor has subscribers.

The method is thread-safe.

Returns:boolean

true if the FlowableProcessor has subscribers

Annotations
@Override
hasThrowableback to summary
public boolean hasThrowable()

Implements abstract io.reactivex.processors.FlowableProcessor.hasThrowable.

Doc from io.reactivex.processors.FlowableProcessor.hasThrowable.

Returns true if the FlowableProcessor has reached a terminal state through an error event.

The method is thread-safe.

Returns:boolean

true if the FlowableProcessor has reached a terminal state through an error event

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onNextback to summary
public void onNext(T t)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
t:T

the element signaled

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements org.reactivestreams.Subscriber.onSubscribe, io.reactivex.FlowableSubscriber.onSubscribe.

Doc from io.reactivex.FlowableSubscriber.onSubscribe.

Implementors of this method should make sure everything that needs to be visible in 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. Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

Doc from org.reactivestreams.Subscriber.onSubscribe.

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
subscribeActualback to summary
protected void subscribeActual(Subscriber<? super T> s)

Implements abstract io.reactivex.Flowable.subscribeActual.

Doc from io.reactivex.Flowable.subscribeActual.

Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Subscribers.

There is no need to call any of the plugin hooks on the current Flowable instance or the Subscriber; all hooks and basic safeguards have been applied by subscribe(Subscriber) before this method gets called.

Parameters
s:Subscriber<? super T>

the incoming Subscriber, never null

Annotations
@Override