Class FlowableCreate.BaseEmitter<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseEmitter​(org.reactivestreams.Subscriber<? super T> downstream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()  
      protected void completeDownstream()  
      protected boolean errorDownstream​(java.lang.Throwable e)  
      boolean isCancelled()
      Returns true if the downstream cancelled the sequence or the emitter was terminated via Emitter.onError(Throwable), Emitter.onComplete() or a successful FlowableEmitter.tryOnError(Throwable).
      void onComplete()
      Signal a completion.
      void onError​(java.lang.Throwable e)
      Signal a Throwable exception.
      (package private) void onRequested()  
      (package private) void onUnsubscribed()  
      void request​(long n)  
      long requested()
      The current outstanding request amount.
      FlowableEmitter<T> serialize()
      Ensures that calls to onNext, onError and onComplete are properly serialized.
      void setCancellable​(Cancellable c)
      Sets a Cancellable on this emitter; any previous Disposable or Cancellable will be disposed/cancelled.
      void setDisposable​(Disposable d)
      Sets a Disposable on this emitter; any previous Disposable or Cancellable will be disposed/cancelled.
      boolean signalError​(java.lang.Throwable e)  
      java.lang.String toString()  
      boolean tryOnError​(java.lang.Throwable e)
      Attempts to emit the specified Throwable error if the downstream hasn't cancelled the sequence or is otherwise terminated, returning false if the emission is not allowed to happen due to lifecycle restrictions.
      • Methods inherited from class java.util.concurrent.atomic.AtomicLong

        accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
      • Methods inherited from class java.lang.Number

        byteValue, shortValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.reactivex.rxjava3.core.Emitter

        onNext
    • Constructor Detail

      • BaseEmitter

        BaseEmitter​(org.reactivestreams.Subscriber<? super T> downstream)
    • Method Detail

      • onComplete

        public void onComplete()
        Description copied from interface: Emitter
        Signal a completion.
        Specified by:
        onComplete in interface Emitter<T>
      • completeDownstream

        protected void completeDownstream()
      • onError

        public final void onError​(java.lang.Throwable e)
        Description copied from interface: Emitter
        Signal a Throwable exception.
        Specified by:
        onError in interface Emitter<T>
        Parameters:
        e - the Throwable to signal, not null
      • tryOnError

        public final boolean tryOnError​(java.lang.Throwable e)
        Description copied from interface: FlowableEmitter
        Attempts to emit the specified Throwable error if the downstream hasn't cancelled the sequence or is otherwise terminated, returning false if the emission is not allowed to happen due to lifecycle restrictions.

        Unlike Emitter.onError(Throwable), the RxjavaPlugins.onError is not called if the error could not be delivered.

        History: 2.1.1 - experimental

        Specified by:
        tryOnError in interface FlowableEmitter<T>
        Parameters:
        e - the throwable error to signal if possible
        Returns:
        true if successful, false if the downstream is not able to accept further events
      • signalError

        public boolean signalError​(java.lang.Throwable e)
      • errorDownstream

        protected boolean errorDownstream​(java.lang.Throwable e)
      • cancel

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

        void onUnsubscribed()
      • request

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

        void onRequested()
      • requested

        public final long requested()
        Description copied from interface: FlowableEmitter
        The current outstanding request amount.

        This method is thread-safe.

        Specified by:
        requested in interface FlowableEmitter<T>
        Returns:
        the current outstanding request amount
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.atomic.AtomicLong