Class ObservableBufferTimed.BufferExactBoundedObserver<T, U extends Collection<? super T>>
java.lang.Object
io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberPad0
io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberWip
io.reactivex.rxjava3.internal.observers.QueueDrainSubscriberPad2
io.reactivex.rxjava3.internal.observers.QueueDrainObserver<T,U,U>
io.reactivex.rxjava3.internal.operators.observable.ObservableBufferTimed.BufferExactBoundedObserver<T,U>
- All Implemented Interfaces:
Observer<T>, Disposable, ObservableQueueDrain<U,U>, Runnable
- Enclosing class:
ObservableBufferTimed<T, U extends Collection<? super T>>
static final class ObservableBufferTimed.BufferExactBoundedObserver<T, U extends Collection<? super T>>
extends QueueDrainObserver<T,U,U>
implements Runnable, Disposable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) U(package private) long(package private) final int(package private) long(package private) final boolean(package private) Disposable(package private) final long(package private) final TimeUnit(package private) Disposable(package private) final Scheduler.WorkerFields inherited from class QueueDrainObserver
cancelled, done, downstream, error, queue -
Constructor Summary
ConstructorsConstructorDescriptionBufferExactBoundedObserver(Observer<? super U> actual, Supplier<U> bufferSupplier, long timespan, TimeUnit unit, int maxSize, boolean restartOnMaxSize, Scheduler.Worker w) -
Method Summary
Modifier and TypeMethodDescriptionvoidAccept the value and return true if forwarded.voiddispose()Dispose the resource, the operation should be idempotent.booleanReturns true if this resource has been disposed.voidNotifies theObserverthat theObservablehas finished sending push-based notifications.voidNotifies theObserverthat theObservablehas experienced an error condition.voidProvides theObserverwith a new item to observe.voidProvides theObserverwith the means of cancelling (disposing) the connection (channel) with theObservablein both synchronous (from withinObserver.onNext(Object)) and asynchronous manner.voidrun()Methods inherited from class QueueDrainObserver
cancelled, done, enter, error, fastPathEmit, fastPathOrderedEmit, leave
-
Field Details
-
bufferSupplier
-
timespan
final long timespan -
unit
-
maxSize
final int maxSize -
restartTimerOnMaxSize
final boolean restartTimerOnMaxSize -
w
-
buffer
U extends Collection<? super T> buffer -
timer
Disposable timer -
upstream
Disposable upstream -
producerIndex
long producerIndex -
consumerIndex
long consumerIndex
-
-
Constructor Details
-
BufferExactBoundedObserver
-
-
Method Details
-
onSubscribe
Description copied from interface:ObserverProvides theObserverwith the means of cancelling (disposing) the connection (channel) with theObservablein both synchronous (from withinObserver.onNext(Object)) and asynchronous manner.- Specified by:
onSubscribein interfaceObserver<T>- Parameters:
d- theDisposableinstance whoseDisposable.dispose()can be called anytime to cancel the connection
-
onNext
Description copied from interface:ObserverProvides theObserverwith 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.onComplete()orObserver.onError(Throwable). -
onError
Description copied from interface:ObserverNotifies theObserverthat theObservablehas experienced an error condition.If the
Observablecalls this method, it will not thereafter callObserver.onNext(T)orObserver.onComplete(). -
onComplete
public void onComplete()Description copied from interface:ObserverNotifies theObserverthat theObservablehas finished sending push-based notifications.The
Observablewill not call this method if it callsObserver.onError(Throwable).- Specified by:
onCompletein interfaceObserver<T>
-
accept
Description copied from interface:ObservableQueueDrainAccept the value and return true if forwarded.- Specified by:
acceptin interfaceObservableQueueDrain<T, U extends Collection<? super T>>- Overrides:
acceptin classQueueDrainObserver<T, U extends Collection<? super T>, U extends Collection<? super T>>- Parameters:
a- the subscriber to deliver values tov- the value to deliver
-
dispose
public void dispose()Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
isDisposed
public boolean isDisposed()Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-
run
-