Package rx.internal.operators
Class OperatorObserveOn.ObserveOnSubscriber<T>
- java.lang.Object
-
- rx.Subscriber<T>
-
- rx.internal.operators.OperatorObserveOn.ObserveOnSubscriber<T>
-
- All Implemented Interfaces:
Action,Action0,Function,Observer<T>,Subscription
- Enclosing class:
- OperatorObserveOn<T>
static final class OperatorObserveOn.ObserveOnSubscriber<T> extends Subscriber<T> implements Action0
Observe through individual queue per observer.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Subscriber<? super T>child(package private) java.util.concurrent.atomic.AtomicLongcounter(package private) booleandelayError(package private) longemittedRemembers how many elements have been emitted before the requests run out.(package private) java.lang.ThrowableerrorThe single exception if not null, should be written before setting finished (release) and read after reading finished (acquire).(package private) booleanfinished(package private) intlimitThe emission threshold that should trigger a replenishing request.(package private) NotificationLite<T>on(package private) java.util.Queue<java.lang.Object>queue(package private) Scheduler.WorkerrecursiveScheduler(package private) java.util.concurrent.atomic.AtomicLongrequested
-
Constructor Summary
Constructors Constructor Description ObserveOnSubscriber(Scheduler scheduler, Subscriber<? super T> child, boolean delayError, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcall()(package private) booleancheckTerminated(boolean done, boolean isEmpty, Subscriber<? super T> a, java.util.Queue<java.lang.Object> q)(package private) voidinit()voidonCompleted()Notifies the Observer that theObservablehas finished sending push-based notifications.voidonError(java.lang.Throwable e)Notifies the Observer that theObservablehas experienced an error condition.voidonNext(T t)Provides the Observer with a new item to observe.protected voidschedule()-
Methods inherited from class rx.Subscriber
add, isUnsubscribed, onStart, request, setProducer, unsubscribe
-
-
-
-
Field Detail
-
child
final Subscriber<? super T> child
-
recursiveScheduler
final Scheduler.Worker recursiveScheduler
-
on
final NotificationLite<T> on
-
delayError
final boolean delayError
-
queue
final java.util.Queue<java.lang.Object> queue
-
limit
final int limit
The emission threshold that should trigger a replenishing request.
-
finished
volatile boolean finished
-
requested
final java.util.concurrent.atomic.AtomicLong requested
-
counter
final java.util.concurrent.atomic.AtomicLong counter
-
error
java.lang.Throwable error
The single exception if not null, should be written before setting finished (release) and read after reading finished (acquire).
-
emitted
long emitted
Remembers how many elements have been emitted before the requests run out.
-
-
Constructor Detail
-
ObserveOnSubscriber
public ObserveOnSubscriber(Scheduler scheduler, Subscriber<? super T> child, boolean delayError, int bufferSize)
-
-
Method Detail
-
init
void init()
-
onNext
public void onNext(T t)
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).
-
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>
-
onError
public void onError(java.lang.Throwable e)
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().
-
schedule
protected void schedule()
-
checkTerminated
boolean checkTerminated(boolean done, boolean isEmpty, Subscriber<? super T> a, java.util.Queue<java.lang.Object> q)
-
-