Package rx.internal.operators
Class CachedObservable.CacheState<T>
java.lang.Object
rx.internal.util.LinkedArrayList
rx.internal.operators.CachedObservable.CacheState<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Observer<T>
- Enclosing class:
CachedObservable<T>
Contains the active child producers and the values to replay.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final SerialSubscriptionHolds onto the subscriber connected to source.(package private) static final CachedObservable.ReplayProducer<?>[]The default empty array of producers.(package private) booleanSet to true after connection.(package private) final NotificationLite<T> (package private) CachedObservable.ReplayProducer<?>[]Guarded by connection (not this).(package private) final Observable<? extends T> The source observable to connect to.(package private) booleanIndicates that the source has completed emitting values or the Observable was forcefully terminated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a ReplayProducer to the producers array atomically.voidconnect()Connects the cache to the source.(package private) voiddispatch()Signals all known children there is work to do.voidNotifies the Observer that theObservablehas finished sending push-based notifications.voidNotifies the Observer that theObservablehas experienced an error condition.voidProvides the Observer with a new item to observe.voidRemoves the ReplayProducer (if present) from the producers array atomically.Methods inherited from class rx.internal.util.LinkedArrayList
add, capacityHint, head, indexInTail, size, tail, toString
-
Field Details
-
source
The source observable to connect to. -
connection
Holds onto the subscriber connected to source. -
producers
Guarded by connection (not this). -
EMPTY
The default empty array of producers. -
nl
-
isConnected
volatile boolean isConnectedSet to true after connection. -
sourceDone
boolean sourceDoneIndicates that the source has completed emitting values or the Observable was forcefully terminated.
-
-
Constructor Details
-
CacheState
-
-
Method Details
-
addProducer
Adds a ReplayProducer to the producers array atomically.- Parameters:
p-
-
removeProducer
Removes the ReplayProducer (if present) from the producers array atomically.- Parameters:
p-
-
connect
public void connect()Connects the cache to the source. Make sure this is called only once. -
onNext
Description copied from interface:ObserverProvides the Observer with a new item to observe.The
Observablemay call this method 0 or more times.The
Observablewill not call this method again after it calls eitherObserver.onCompleted()orObserver.onError(java.lang.Throwable). -
onError
Description copied from interface:ObserverNotifies the Observer that theObservablehas experienced an error condition.If the
Observablecalls this method, it will not thereafter callObserver.onNext(T)orObserver.onCompleted(). -
onCompleted
public void onCompleted()Description copied from interface:ObserverNotifies the Observer that theObservablehas finished sending push-based notifications.The
Observablewill not call this method if it callsObserver.onError(java.lang.Throwable).- Specified by:
onCompletedin interfaceObserver<T>
-
dispatch
void dispatch()Signals all known children there is work to do.
-