Interface QueueSubscription<T>
-
- Type Parameters:
T
- the value type transmitted through the queue
- All Superinterfaces:
QueueFuseable<T>
,SimpleQueue<T>
,org.reactivestreams.Subscription
- All Known Implementing Classes:
AbstractEmptyQueueFuseable
,AsyncProcessor.AsyncSubscription
,BasicFuseableConditionalSubscriber
,BasicFuseableSubscriber
,BasicIntQueueSubscription
,BasicQueueSubscription
,CancellableQueueFuseable
,DeferredScalarSubscriber
,DeferredScalarSubscription
,EmptySubscription
,FlowableAll.AllSubscriber
,FlowableAny.AnySubscriber
,FlowableCollect.CollectSubscriber
,FlowableCollectWithCollector.CollectorSubscriber
,FlowableCombineLatest.CombineLatestCoordinator
,FlowableCount.CountSubscriber
,FlowableDistinct.DistinctSubscriber
,FlowableDistinctUntilChanged.DistinctUntilChangedConditionalSubscriber
,FlowableDistinctUntilChanged.DistinctUntilChangedSubscriber
,FlowableDoAfterNext.DoAfterConditionalSubscriber
,FlowableDoAfterNext.DoAfterSubscriber
,FlowableDoFinally.DoFinallyConditionalSubscriber
,FlowableDoFinally.DoFinallySubscriber
,FlowableDoOnEach.DoOnEachConditionalSubscriber
,FlowableDoOnEach.DoOnEachSubscriber
,FlowableElementAt.ElementAtSubscriber
,FlowableFilter.FilterConditionalSubscriber
,FlowableFilter.FilterSubscriber
,FlowableFlatMapCompletable.FlatMapCompletableMainSubscriber
,FlowableFlattenIterable.FlattenIterableSubscriber
,FlowableFromArray.ArrayConditionalSubscription
,FlowableFromArray.ArraySubscription
,FlowableFromArray.BaseArraySubscription
,FlowableFromCompletable.FromCompletableObserver
,FlowableFromCompletionStage.CompletionStageHandler
,FlowableFromIterable.BaseRangeSubscription
,FlowableFromIterable.IteratorConditionalSubscription
,FlowableFromIterable.IteratorSubscription
,FlowableFromStream.AbstractStreamSubscription
,FlowableFromStream.StreamConditionalSubscription
,FlowableFromStream.StreamSubscription
,FlowableGroupBy.State
,FlowableIgnoreElements.IgnoreElementsSubscriber
,FlowableMap.MapConditionalSubscriber
,FlowableMap.MapSubscriber
,FlowableMapOptional.MapOptionalConditionalSubscriber
,FlowableMapOptional.MapOptionalSubscriber
,FlowableObserveOn.BaseObserveOnSubscriber
,FlowableObserveOn.ObserveOnConditionalSubscriber
,FlowableObserveOn.ObserveOnSubscriber
,FlowableOnBackpressureBuffer.BackpressureBufferSubscriber
,FlowableRange.BaseRangeSubscription
,FlowableRange.RangeConditionalSubscription
,FlowableRange.RangeSubscription
,FlowableRangeLong.BaseRangeSubscription
,FlowableRangeLong.RangeConditionalSubscription
,FlowableRangeLong.RangeSubscription
,FlowableReduce.ReduceSubscriber
,FlowableSequenceEqual.EqualCoordinator
,FlowableSingle.SingleElementSubscriber
,FlowableTakeLastOne.TakeLastOneSubscriber
,FlowableToList.ToListSubscriber
,MaybeFlatMapIterableFlowable.FlatMapIterableObserver
,MaybeFlattenStreamAsFlowable.FlattenStreamMultiObserver
,MaybeMergeArray.MergeMaybeObserver
,MaybeToFlowable.MaybeToFlowableSubscriber
,ObservableFromCompletable.FromCompletableObserver
,ParallelCollect.ParallelCollectSubscriber
,ParallelCollector.ParallelCollectorSubscriber
,ParallelReduce.ParallelReduceSubscriber
,ParallelReduceFull.ParallelReduceFullMainSubscriber
,ScalarSubscription
,SingleFlatMapIterableFlowable.FlatMapIterableObserver
,SingleToFlowable.SingleToFlowableObserver
,UnicastProcessor.UnicastQueueSubscription
public interface QueueSubscription<@NonNull T> extends QueueFuseable<T>, org.reactivestreams.Subscription
An interface extendingSimpleQueue
andSubscription
and allows negotiating the fusion mode between subsequent operators of theFlowable
base reactive type.The negotiation happens in subscription time when the upstream calls the
onSubscribe
with an instance of this interface. The downstream has then the obligation to callQueueFuseable.requestFusion(int)
with the appropriate mode before callingrequest()
.In synchronous fusion, all upstream values are either already available or is generated when
SimpleQueue.poll()
is called synchronously. When theSimpleQueue.poll()
returns null, that is the indication if a terminated stream. Downstream should not callSubscription.request(long)
in this mode. In this mode, the upstream won't call the onXXX methods.In asynchronous fusion, upstream values may become available to
SimpleQueue.poll()
eventually. Upstream signalsonError()
andonComplete()
as usual, however,onNext
will be called withnull
instead of the actual value. Downstream should treat such onNext as indication thatSimpleQueue.poll()
can be called. In this mode, the downstream still has to callSubscription.request(long)
to indicate it is prepared to receive more values.The general rules for consuming the
SimpleQueue
interface:-
SimpleQueue.poll()
andSimpleQueue.clear()
has to be called sequentially (from within a serializing drain-loop). - In addition, callers of
SimpleQueue.poll()
should be prepared to catch exceptions. - Due to how computation attaches to the
SimpleQueue.poll()
,SimpleQueue.poll()
may returnnull
even if a precedingSimpleQueue.isEmpty()
returned false.
Implementations should only allow calling the following methods and the rest of the
SimpleQueue
interface methods should throwUnsupportedOperationException
:- Since:
- 3.1.1
- See Also:
QueueDisposable
-
-
Method Summary
-
Methods inherited from interface io.reactivex.rxjava3.operators.QueueFuseable
requestFusion
-
-