Interface QueueDisposable<T>
-
- Type Parameters:
T- the value type transmitted through the queue
- All Superinterfaces:
Disposable,QueueFuseable<T>,SimpleQueue<T>
- All Known Implementing Classes:
AbstractEmptyQueueFuseable,AsyncSubject.AsyncDisposable,BasicFuseableObserver,BasicIntQueueDisposable,BasicQueueDisposable,CancellableQueueFuseable,DeferredScalarDisposable,DeferredScalarObserver,EmptyDisposable,FlowableFromCompletable.FromCompletableObserver,MaybeFlatMapIterableObservable.FlatMapIterableObserver,MaybeFlattenStreamAsObservable.FlattenStreamMultiObserver,MaybeToObservable.MaybeToObservableObserver,ObservableCollectWithCollector.CollectorObserver,ObservableDistinct.DistinctObserver,ObservableDistinctUntilChanged.DistinctUntilChangedObserver,ObservableDoAfterNext.DoAfterObserver,ObservableDoFinally.DoFinallyObserver,ObservableFilter.FilterObserver,ObservableFlatMapCompletable.FlatMapCompletableMainObserver,ObservableFromArray.FromArrayDisposable,ObservableFromCompletable.FromCompletableObserver,ObservableFromCompletionStage.CompletionStageHandler,ObservableFromIterable.FromIterableDisposable,ObservableFromStream.StreamDisposable,ObservableMap.MapObserver,ObservableMapOptional.MapOptionalObserver,ObservableObserveOn.ObserveOnObserver,ObservableRange.RangeDisposable,ObservableRangeLong.RangeDisposable,ObservableScalarXMap.ScalarDisposable,SingleFlatMapIterableObservable.FlatMapIterableObserver,SingleToObservable.SingleToObservableObserver,UnicastSubject.UnicastQueueDisposable
public interface QueueDisposable<@NonNull T> extends QueueFuseable<T>, Disposable
An interface extendingSimpleQueueandDisposableand allows negotiating the fusion mode between subsequent operators of theObservablebase reactive type.The negotiation happens in subscription time when the upstream calls the
onSubscribewith 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()returnsnull, that is the indication if a terminated stream. 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,onNextwill be called withnullinstead of the actual value. Downstream should treat such onNext as indication thatSimpleQueue.poll()can be called.The general rules for consuming the
SimpleQueueinterface:-
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 returnnulleven if a precedingSimpleQueue.isEmpty()returned false.
Implementations should only allow calling the following methods and the rest of the
SimpleQueueinterface methods should throwUnsupportedOperationException:- Since:
- 3.1.1
- See Also:
QueueSubscription
-
-
Method Summary
-
Methods inherited from interface io.reactivex.rxjava3.disposables.Disposable
dispose, isDisposed
-
Methods inherited from interface io.reactivex.rxjava3.operators.QueueFuseable
requestFusion
-
-