Interface MultiEmitter<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void complete()
      Emits a completion event downstream indicating that no more item will be sent.
      MultiEmitter<T> emit​(T item)
      Emits an item event downstream.
      void fail​(java.lang.Throwable failure)
      Emits a failure event downstream with the given exception.
      boolean isCancelled()  
      MultiEmitter<T> onTermination​(java.lang.Runnable onTermination)
      Attaches a @{code termination} event handler invoked when the downstream Subscription is cancelled, or when the emitter has emitted either a completion or failure event.
      long requested()  
    • Method Detail

      • emit

        MultiEmitter<T> emit​(T item)
        Emits an item event downstream.

        Calling this method after a failure or a completion events has no effect.

        Parameters:
        item - the item, must not be null
        Returns:
        this emitter, so firing item events can be chained.
      • fail

        void fail​(java.lang.Throwable failure)
        Emits a failure event downstream with the given exception.

        Calling this method multiple times or after the complete() method has no effect.

        Parameters:
        failure - the exception, must not be null
      • complete

        void complete()
        Emits a completion event downstream indicating that no more item will be sent.

        Calling this method multiple times or after the fail(Throwable) method has no effect.

      • onTermination

        MultiEmitter<T> onTermination​(java.lang.Runnable onTermination)
        Attaches a @{code termination} event handler invoked when the downstream Subscription is cancelled, or when the emitter has emitted either a completion or failure event.

        This method allows cleanup resources once the emitter can be disposed (has reached a terminal state).

        If the registration of the onTermination callback is done after the termination, it invokes the callback immediately.

        Parameters:
        onTermination - the action to run on termination, must not be null
        Returns:
        this emitter
      • isCancelled

        boolean isCancelled()
        Returns:
        true if the downstream cancelled the stream or the emitter was terminated (with a completion or failure events).
      • requested

        long requested()
        Returns:
        the current outstanding request amount.