Class FlowableOperatorCollapseRuns.SubscriberImpl

java.lang.Object
org.aksw.commons.rx.op.FlowableOperatorCollapseRuns.SubscriberImpl
All Implemented Interfaces:
io.reactivex.rxjava3.core.FlowableSubscriber<T>, org.reactivestreams.Subscriber<T>, org.reactivestreams.Subscription
Enclosing class:
FlowableOperatorCollapseRuns<T,K,V>

public class FlowableOperatorCollapseRuns.SubscriberImpl extends Object implements io.reactivex.rxjava3.core.FlowableSubscriber<T>, org.reactivestreams.Subscription
  • Field Details

    • downstream

      protected org.reactivestreams.Subscriber<? super Map.Entry<K,V>> downstream
    • upstream

      protected org.reactivestreams.Subscription upstream
    • priorKey

      protected K priorKey
    • currentKey

      protected K currentKey
    • accNum

      protected long accNum
    • currentAcc

      protected V currentAcc
    • isUpstreamComplete

      protected volatile boolean isUpstreamComplete
    • lastItemSent

      protected volatile boolean lastItemSent
    • pending

      protected AtomicLong pending
  • Constructor Details

    • SubscriberImpl

      public SubscriberImpl(org.reactivestreams.Subscriber<? super Map.Entry<K,V>> downstream)
  • Method Details

    • onSubscribe

      public void onSubscribe(org.reactivestreams.Subscription s)
      Specified by:
      onSubscribe in interface io.reactivex.rxjava3.core.FlowableSubscriber<T>
      Specified by:
      onSubscribe in interface org.reactivestreams.Subscriber<T>
    • onNext

      public void onNext(T item)
      Specified by:
      onNext in interface org.reactivestreams.Subscriber<T>
    • trySendLastItem

      protected void trySendLastItem()
      If there is a remaining request upon onComplete then the last item can be sent out at that time. Otherwise we have to wait for additional requests.
    • onComplete

      public void onComplete()
      Called when the upstream completes
      Specified by:
      onComplete in interface org.reactivestreams.Subscriber<T>
    • onError

      public void onError(Throwable t)
      Specified by:
      onError 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