Class FlowableBufferTimed.BufferExactUnboundedSubscriber<T,​U extends java.util.Collection<? super T>>

  • All Implemented Interfaces:
    FlowableSubscriber<T>, Disposable, QueueDrain<U,​U>, java.lang.Runnable, org.reactivestreams.Subscriber<T>, org.reactivestreams.Subscription
    Enclosing class:
    FlowableBufferTimed<T,​U extends java.util.Collection<? super T>>

    static final class FlowableBufferTimed.BufferExactUnboundedSubscriber<T,​U extends java.util.Collection<? super T>>
    extends QueueDrainSubscriber<T,​U,​U>
    implements org.reactivestreams.Subscription, java.lang.Runnable, Disposable
    • Field Detail

      • bufferSupplier

        final Supplier<U extends java.util.Collection<? super T>> bufferSupplier
      • timespan

        final long timespan
      • unit

        final java.util.concurrent.TimeUnit unit
      • upstream

        org.reactivestreams.Subscription upstream
      • buffer

        U extends java.util.Collection<? super T> buffer
      • timer

        final java.util.concurrent.atomic.AtomicReference<Disposable> timer
    • Constructor Detail

      • BufferExactUnboundedSubscriber

        BufferExactUnboundedSubscriber​(org.reactivestreams.Subscriber<? super U> actual,
                                       Supplier<U> bufferSupplier,
                                       long timespan,
                                       java.util.concurrent.TimeUnit unit,
                                       Scheduler scheduler)
    • Method Detail

      • onSubscribe

        public void onSubscribe​(org.reactivestreams.Subscription s)
        Description copied from interface: FlowableSubscriber
        Implementors of this method should make sure everything that needs to be visible in 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.
        Specified by:
        onSubscribe in interface FlowableSubscriber<T>
        Specified by:
        onSubscribe in interface org.reactivestreams.Subscriber<T>
      • onNext

        public void onNext​(T t)
        Specified by:
        onNext in interface org.reactivestreams.Subscriber<T>
      • onError

        public void onError​(java.lang.Throwable t)
        Specified by:
        onError in interface org.reactivestreams.Subscriber<T>
      • onComplete

        public void onComplete()
        Specified by:
        onComplete in interface org.reactivestreams.Subscriber<T>
      • request

        public void request​(long n)
        Specified by:
        request in interface org.reactivestreams.Subscription
      • cancel

        public void cancel()
        Specified by:
        cancel in interface org.reactivestreams.Subscription
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • accept

        public boolean accept​(org.reactivestreams.Subscriber<? super U> a,
                              U v)
        Description copied from interface: QueueDrain
        Accept the value and return true if forwarded.
        Specified by:
        accept in interface QueueDrain<T,​U extends java.util.Collection<? super T>>
        Overrides:
        accept in class QueueDrainSubscriber<T,​U extends java.util.Collection<? super T>,​U extends java.util.Collection<? super T>>
        Parameters:
        a - the subscriber
        v - the value
        Returns:
        true if the value was delivered
      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Dispose the resource, the operation should be idempotent.
        Specified by:
        dispose in interface Disposable
      • isDisposed

        public boolean isDisposed()
        Description copied from interface: Disposable
        Returns true if this resource has been disposed.
        Specified by:
        isDisposed in interface Disposable
        Returns:
        true if this resource has been disposed