public static final class FlowableGroupBy.GroupBySubscriber<T,K,V> extends BasicIntQueueSubscription<GroupedFlowable<K,V>> implements FlowableSubscriber<T>
Constructor and Description |
---|
GroupBySubscriber(org.reactivestreams.Subscriber<? super GroupedFlowable<K,V>> actual,
Function<? super T,? extends K> keySelector,
Function<? super T,? extends V> valueSelector,
int bufferSize,
boolean delayError,
Map<Object,io.reactivex.internal.operators.flowable.FlowableGroupBy.GroupedUnicast<K,V>> groups,
Queue<io.reactivex.internal.operators.flowable.FlowableGroupBy.GroupedUnicast<K,V>> evictedGroups) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
cancel(K key) |
void |
clear()
Removes all enqueued items from this queue.
|
boolean |
isEmpty()
Returns true if the queue is empty.
|
void |
onComplete() |
void |
onError(Throwable t) |
void |
onNext(T t) |
void |
onSubscribe(org.reactivestreams.Subscription s)
Implementors of this method should make sure everything that needs
to be visible in
Subscriber.onNext(Object) is established before
calling Subscription.request(long) . |
GroupedFlowable<K,V> |
poll()
Tries to dequeue a value (non-null) or returns null if
the queue is empty.
|
void |
request(long n) |
int |
requestFusion(int mode)
Request a fusion mode from the upstream.
|
offer, offer
accumulateAndGet, addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, incrementAndGet, intValue, lazySet, longValue, set, toString, updateAndGet, weakCompareAndSet
byteValue, shortValue
public GroupBySubscriber(org.reactivestreams.Subscriber<? super GroupedFlowable<K,V>> actual, Function<? super T,? extends K> keySelector, Function<? super T,? extends V> valueSelector, int bufferSize, boolean delayError, Map<Object,io.reactivex.internal.operators.flowable.FlowableGroupBy.GroupedUnicast<K,V>> groups, Queue<io.reactivex.internal.operators.flowable.FlowableGroupBy.GroupedUnicast<K,V>> evictedGroups)
public void onSubscribe(org.reactivestreams.Subscription s)
FlowableSubscriber
Subscriber.onNext(Object)
is established before
calling Subscription.request(long)
. In practice this means
no initialization should happen after the request()
call and
additional behavior is thread safe in respect to onNext
.
onSubscribe
in interface FlowableSubscriber<T>
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public void onError(Throwable t)
onError
in interface org.reactivestreams.Subscriber<T>
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<T>
public void request(long n)
request
in interface org.reactivestreams.Subscription
public void cancel()
cancel
in interface org.reactivestreams.Subscription
public void cancel(K key)
public int requestFusion(int mode)
QueueFuseable
This should be called before onSubscribe
returns.
Calling this method multiple times or after onSubscribe
finished is not allowed
and may result in undefined behavior.
requestFusion
in interface QueueFuseable<GroupedFlowable<K,V>>
mode
- the requested fusion mode, allowed values are QueueFuseable.SYNC
, QueueFuseable.ASYNC
,
QueueFuseable.ANY
combined with QueueFuseable.BOUNDARY
(e.g., requestFusion(SYNC | BOUNDARY)
).QueueFuseable.NONE
, QueueFuseable.SYNC
, QueueFuseable.ASYNC
.@Nullable public GroupedFlowable<K,V> poll()
SimpleQueue
If the producer uses SimpleQueue.offer(Object, Object)
and
when polling in pairs, if the first poll() returns a non-null
item, the second poll() is guaranteed to return a non-null item
as well.
poll
in interface SimpleQueue<GroupedFlowable<K,V>>
public void clear()
SimpleQueue
clear
in interface SimpleQueue<GroupedFlowable<K,V>>
public boolean isEmpty()
SimpleQueue
Note however that due to potential fused functions in SimpleQueue.poll()
it is possible this method returns false but then poll() returns null
because the fused function swallowed the available item(s).
isEmpty
in interface SimpleQueue<GroupedFlowable<K,V>>
Copyright © 2018 JBoss by Red Hat. All rights reserved.