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 int
LIMIT
private java.util.concurrent.BlockingQueue<Notification<? extends T>>
notifications
private int
received
-
Constructor Summary
Constructors Constructor Description SubscriberIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
T
next()
void
onCompleted()
Notifies the Observer that theObservable
has finished sending push-based notifications.void
onError(java.lang.Throwable e)
Notifies the Observer that theObservable
has experienced an error condition.void
onNext(Notification<? extends T> args)
Provides the Observer with a new item to observe.void
onStart()
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.void
remove()
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:Subscriber
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. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.- Overrides:
onStart
in classSubscriber<Notification<? extends T>>
-
onCompleted
public void onCompleted()
Description copied from interface:Observer
Notifies the Observer that theObservable
has finished sending push-based notifications.The
Observable
will not call this method if it callsObserver.onError(java.lang.Throwable)
.- Specified by:
onCompleted
in interfaceObserver<T>
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:Observer
Notifies the Observer that theObservable
has experienced an error condition.If the
Observable
calls this method, it will not thereafter callObserver.onNext(T)
orObserver.onCompleted()
.
-
onNext
public void onNext(Notification<? extends T> args)
Description copied from interface:Observer
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 eitherObserver.onCompleted()
orObserver.onError(java.lang.Throwable)
.
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
take
private Notification<? extends T> take()
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
-