Top Description Inners Fields Constructors Methods
rx.observers

public Class SerializedObserver<T>

extends Object
implements Observer<T>
Class Inheritance
All Implemented Interfaces
rx.Observer
Type Parameters
<T>
the type of items expected to be observed by the Observer
Imports
rx.Observer, rx.exceptions.*, rx.internal.operators.NotificationLite

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

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final Observer<? super T>
private boolean
private SerializedObserver.FastList
queue

If not null, it indicates more work.

private volatile boolean
terminated

Set to true if a terminal event was received.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
onCompleted()

Implements rx.Observer.onCompleted.

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

Implements rx.Observer.onError.

Notifies the Observer 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 Observer with a new item to observe.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actualback to summary
private final Observer<? super T> actual
emittingback to summary
private boolean emitting
queueback to summary
private SerializedObserver.FastList queue

If not null, it indicates more work.

terminatedback to summary
private volatile boolean terminated

Set to true if a terminal event was received.

Constructor Detail

SerializedObserverback to summary
public SerializedObserver(Observer<? super T> s)

Method Detail

onCompletedback to summary
public void onCompleted()

Implements rx.Observer.onCompleted.

Doc from rx.Observer.onCompleted.

Notifies the Observer 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(final Throwable e)

Implements rx.Observer.onError.

Doc from rx.Observer.onError.

Notifies the Observer 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.

Doc from rx.Observer.onNext.

Provides the Observer 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
rx.observers back to summary

pack-priv final Class SerializedObserver.FastList

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv Object[]
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayback to summary
pack-priv Object[] array
sizeback to summary
pack-priv int size

Constructor Detail

FastListback to summary
pack-priv FastList()

Method Detail

addback to summary
public void add(Object o)