Class FlowableFromRunnable<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    Supplier<T>, org.reactivestreams.Publisher<T>

    public final class FlowableFromRunnable<T>
    extends Flowable<T>
    implements Supplier<T>
    Executes an Runnable and signals its exception or completes normally.
    Since:
    3.0.0
    • Field Detail

      • run

        final java.lang.Runnable run
    • Constructor Detail

      • FlowableFromRunnable

        public FlowableFromRunnable​(java.lang.Runnable run)
    • Method Detail

      • subscribeActual

        protected void subscribeActual​(org.reactivestreams.Subscriber<? super T> subscriber)
        Description copied from class: Flowable
        Operator implementations (both source and intermediate) should implement this method that performs the necessary business logic and handles the incoming Subscribers.

        There is no need to call any of the plugin hooks on the current Flowable instance or the Subscriber; all hooks and basic safeguards have been applied by Flowable.subscribe(Subscriber) before this method gets called.

        Specified by:
        subscribeActual in class Flowable<T>
        Parameters:
        subscriber - the incoming Subscriber, never null
      • get

        public T get()
              throws java.lang.Throwable
        Description copied from interface: Supplier
        Produces a value or throws an exception.
        Specified by:
        get in interface Supplier<T>
        Returns:
        the value produced
        Throws:
        java.lang.Throwable - if the implementation wishes to throw any type of exception