Class ObservableCreate.CreateEmitter<T>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Dispose the resource, the operation should be idempotent.
      boolean isDisposed()
      Returns true if the downstream disposed the sequence or the emitter was terminated via Emitter.onError(Throwable), Emitter.onComplete() or a successful ObservableEmitter.tryOnError(Throwable).
      void onComplete()
      Signal a completion.
      void onError​(java.lang.Throwable t)
      Signal a Throwable exception.
      void onNext​(T t)
      Signal a normal value.
      ObservableEmitter<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.
      java.lang.String toString()  
      boolean tryOnError​(java.lang.Throwable t)
      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.AtomicReference

        accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CreateEmitter

        CreateEmitter​(Observer<? super T> observer)
    • Method Detail

      • onNext

        public void onNext​(T t)
        Description copied from interface: Emitter
        Signal a normal value.
        Specified by:
        onNext in interface Emitter<T>
        Parameters:
        t - the value to signal, not null
      • onError

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

        public boolean tryOnError​(java.lang.Throwable t)
        Description copied from interface: ObservableEmitter
        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 ObservableEmitter<T>
        Parameters:
        t - the Throwable error to signal if possible
        Returns:
        true if successful, false if the downstream is not able to accept further events
      • onComplete

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.util.concurrent.atomic.AtomicReference<Disposable>