Package rx.internal.operators
Class OperatorGroupBy.GroupBySubscriber<T,K,V>
- java.lang.Object
-
- rx.Subscriber<T>
-
- rx.internal.operators.OperatorGroupBy.GroupBySubscriber<T,K,V>
-
- All Implemented Interfaces:
Observer<T>,Subscription
- Enclosing class:
- OperatorGroupBy<T,K,V>
public static final class OperatorGroupBy.GroupBySubscriber<T,K,V> extends Subscriber<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classOperatorGroupBy.GroupBySubscriber.EvictionAction<K>
-
Field Summary
Fields Modifier and Type Field Description (package private) Subscriber<? super GroupedObservable<K,V>>actual(package private) intbufferSize(package private) java.util.concurrent.atomic.AtomicBooleancancelled(package private) booleandelayError(package private) booleandone(package private) java.lang.Throwableerror(package private) java.util.Queue<K>evictedKeys(package private) java.util.concurrent.atomic.AtomicIntegergroupCount(package private) java.util.Map<java.lang.Object,OperatorGroupBy.GroupedUnicast<K,V>>groups(package private) Func1<? super T,? extends K>keySelector(package private) static java.lang.ObjectNULL_KEY(package private) OperatorGroupBy.GroupByProducerproducer(package private) java.util.Queue<GroupedObservable<K,V>>queue(package private) java.util.concurrent.atomic.AtomicLongrequested(package private) ProducerArbiters(package private) Func1<? super T,? extends V>valueSelector(package private) java.util.concurrent.atomic.AtomicIntegerwip
-
Constructor Summary
Constructors Constructor Description GroupBySubscriber(Subscriber<? super GroupedObservable<K,V>> actual, Func1<? super T,? extends K> keySelector, Func1<? super T,? extends V> valueSelector, int bufferSize, boolean delayError, Func1<Action1<K>,java.util.Map<K,java.lang.Object>> mapFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidcancel(K key)(package private) booleancheckTerminated(boolean d, boolean empty, Subscriber<? super GroupedObservable<K,V>> a, java.util.Queue<?> q)private java.util.Map<java.lang.Object,OperatorGroupBy.GroupedUnicast<K,V>>createMap(Func1<Action1<K>,java.util.Map<K,java.lang.Object>> mapFactory, Action1<K> evictionAction)(package private) voiddrain()(package private) voiderrorAll(Subscriber<? super GroupedObservable<K,V>> a, java.util.Queue<?> q, java.lang.Throwable ex)voidonCompleted()Notifies the Observer that theObservablehas finished sending push-based notifications.voidonError(java.lang.Throwable t)Notifies the Observer that theObservablehas experienced an error condition.voidonNext(T t)Provides the Observer with a new item to observe.voidrequestMore(long n)voidsetProducer(Producer s)If other subscriber is set (by calling constructorSubscriber(Subscriber)orSubscriber(Subscriber, boolean)) then this method callssetProduceron the other subscriber.-
Methods inherited from class rx.Subscriber
add, isUnsubscribed, onStart, request, unsubscribe
-
-
-
-
Field Detail
-
actual
final Subscriber<? super GroupedObservable<K,V>> actual
-
bufferSize
final int bufferSize
-
delayError
final boolean delayError
-
groups
final java.util.Map<java.lang.Object,OperatorGroupBy.GroupedUnicast<K,V>> groups
-
queue
final java.util.Queue<GroupedObservable<K,V>> queue
-
producer
final OperatorGroupBy.GroupByProducer producer
-
evictedKeys
final java.util.Queue<K> evictedKeys
-
NULL_KEY
static final java.lang.Object NULL_KEY
-
s
final ProducerArbiter s
-
cancelled
final java.util.concurrent.atomic.AtomicBoolean cancelled
-
requested
final java.util.concurrent.atomic.AtomicLong requested
-
groupCount
final java.util.concurrent.atomic.AtomicInteger groupCount
-
error
java.lang.Throwable error
-
done
volatile boolean done
-
wip
final java.util.concurrent.atomic.AtomicInteger wip
-
-
Method Detail
-
createMap
private java.util.Map<java.lang.Object,OperatorGroupBy.GroupedUnicast<K,V>> createMap(Func1<Action1<K>,java.util.Map<K,java.lang.Object>> mapFactory, Action1<K> evictionAction)
-
setProducer
public void setProducer(Producer s)
Description copied from class:SubscriberIf other subscriber is set (by calling constructorSubscriber(Subscriber)orSubscriber(Subscriber, boolean)) then this method callssetProduceron the other subscriber. If the other subscriber is not set and no requests have been made to this subscriber thenp.request(Long.MAX_VALUE)is called. If the other subscriber is not set and some requests have been made to this subscriber thenp.request(n)is called where n is the accumulated requests to this subscriber.- Overrides:
setProducerin classSubscriber<T>- Parameters:
s- producer to be used by this subscriber or the other subscriber (or recursively its other subscriber) to make requests from
-
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).- Parameters:
t- the item emitted by the Observable
-
onError
public void onError(java.lang.Throwable t)
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().- Parameters:
t- the exception encountered by the Observable
-
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).
-
requestMore
public void requestMore(long n)
-
cancel
public void cancel()
-
cancel
public void cancel(K key)
-
drain
void drain()
-
errorAll
void errorAll(Subscriber<? super GroupedObservable<K,V>> a, java.util.Queue<?> q, java.lang.Throwable ex)
-
checkTerminated
boolean checkTerminated(boolean d, boolean empty, Subscriber<? super GroupedObservable<K,V>> a, java.util.Queue<?> q)
-
-