Top Description Fields Constructors Methods
rx.observers

public Class SerializedSubscriber<T>

extends Subscriber<T>
Class Inheritance
Type Parameters
<T>
the type of items expected to be emitted to the Subscriber
Imports
rx.*

Enforces single-threaded, serialized, ordered execution of onNext, onCompleted, and onError.

When multiple threads are emitting and/or notifying they will be serialized by:

Field Summary

Modifier and TypeField and Description
private final Observer<T>
s

Constructor Summary

AccessConstructor and Description
public
public
SerializedSubscriber(Subscriber<? super T>
the subscriber to wrap and serialize
s
,
boolean
if true, the same subscription list is shared between this subscriber and s.
shareSubscriptions
)

Constructor for wrapping and serializing a subscriber optionally sharing the same underlying subscription list.

Method Summary

Modifier and TypeMethod and Description
public void
onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Subscriber that the Observable has finished sending push-based notifications.
public void
onError(Throwable
the exception encountered by the Observable
e
)

Implements rx.Observer.onError.

Notifies the Subscriber that the Observable has experienced an error condition.
public void
onNext(T
the item emitted by the Observable
t
)

Implements rx.Observer.onNext.

Provides the Subscriber with a new item to observe.
Inherited from rx.Subscriber:
addisUnsubscribedonStartrequestsetProducerunsubscribe

Field Detail

sback to summary
private final Observer<T> s

Constructor Detail

SerializedSubscriberback to summary
public SerializedSubscriber(Subscriber<? super T> s)
SerializedSubscriberback to summary
public SerializedSubscriber(Subscriber<? super T> s, boolean shareSubscriptions)

Constructor for wrapping and serializing a subscriber optionally sharing the same underlying subscription list.

Parameters
s:Subscriber<? super T>

the subscriber to wrap and serialize

shareSubscriptions:boolean

if true, the same subscription list is shared between this subscriber and s.

Since
1.0.7

Method Detail

onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Notifies the Subscriber that the Observable has finished sending push-based notifications.

The Observable will not call this method if it calls onError.

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

Implements rx.Observer.onError.

Notifies the Subscriber that the Observable has experienced an error condition.

If the Observable calls this method, it will not thereafter call onNext or onCompleted.

Parameters
e:Throwable

the exception encountered by the Observable

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

Implements rx.Observer.onNext.

Provides the Subscriber with a new item to observe.

The Observable may call this method 0 or more times.

The Observable will not call this method again after it calls either onCompleted or onError.

Parameters
t:T

the item emitted by the Observable

Annotations
@Override