Class NonoProcessor

  • All Implemented Interfaces:
    Processor<java.lang.Void,​java.lang.Void>, Publisher<java.lang.Void>, Subscriber<java.lang.Void>

    public final class NonoProcessor
    extends Nono
    implements Processor<java.lang.Void,​java.lang.Void>
    A hot Nono that signals the terminal event to Subscribers.

    NonoProcessor is thread-safe and naturally serialized on its onXXX methods.

    Since:
    0.12.0
    • Method Detail

      • create

        public static NonoProcessor create()
        Creates a NonoProcessor instance ready to receive events and Subscribers.
        Returns:
        the new NonoProcessor instance
      • onNext

        public void onNext​(java.lang.Void t)
        Specified by:
        onNext in interface Subscriber<java.lang.Void>
      • onError

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

        public void onComplete()
        Specified by:
        onComplete in interface Subscriber<java.lang.Void>
      • subscribeActual

        protected void subscribeActual​(Subscriber<? super java.lang.Void> s)
        Description copied from class: Nono
        Implement this method to signal the terminal events to the given subscriber.
        Specified by:
        subscribeActual in class Nono
        Parameters:
        s - the downstream subscriber, not null
      • hasSubscribers

        public boolean hasSubscribers()
        Returns true if this NonoProcessor currently has Subscribers.
        Returns:
        true if there are subscribers
      • hasComplete

        public boolean hasComplete()
        Returns true if this NonoProcessor has completed normally.
        Returns:
        true if completed normally
      • hasThrowable

        public boolean hasThrowable()
        Returns true if this NonoProcessor has terminated with an error.
        Returns:
        true if terminated with an error
        See Also:
        getThrowable()
      • getThrowable

        public java.lang.Throwable getThrowable()
        Returns the error that terminated this NonoProcessor if hasThrowable() returns true.
        Returns:
        the error Throwable that terminated this NonoProcessor