Package rx.internal.operators
Class BlockingOperatorToIterator.SubscriberIterator<T>
- java.lang.Object
-
- rx.Subscriber<Notification<? extends T>>
-
- rx.internal.operators.BlockingOperatorToIterator.SubscriberIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>,Observer<Notification<? extends T>>,Subscription
- Enclosing class:
- BlockingOperatorToIterator
public static final class BlockingOperatorToIterator.SubscriberIterator<T> extends Subscriber<Notification<? extends T>> implements java.util.Iterator<T>
-
-
Field Summary
Fields Modifier and Type Field Description private Notification<? extends T>buf(package private) static intLIMITprivate java.util.concurrent.BlockingQueue<Notification<? extends T>>notificationsprivate intreceived
-
Constructor Summary
Constructors Constructor Description SubscriberIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Tnext()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(Notification<? extends T> args)Provides the Observer with a new item to observe.voidonStart()This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber.voidremove()private Notification<? extends T>take()-
Methods inherited from class rx.Subscriber
add, isUnsubscribed, request, setProducer, unsubscribe
-
-
-
-
Field Detail
-
LIMIT
static final int LIMIT
-
notifications
private final java.util.concurrent.BlockingQueue<Notification<? extends T>> notifications
-
buf
private Notification<? extends T> buf
-
received
private int received
-
-
Method Detail
-
onStart
public void onStart()
Description copied from class:SubscriberThis method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.- Overrides:
onStartin classSubscriber<Notification<? extends T>>
-
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().
-
onNext
public void onNext(Notification<? extends T> args)
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).
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<T>
-
take
private Notification<? extends T> take()
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<T>
-
-