Class FlowableBlockingSubscribe


  • public final class FlowableBlockingSubscribe
    extends java.lang.Object
    Utility methods to consume a Publisher in a blocking manner with callbacks or Subscriber.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> source)
      Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
      static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> o, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Action onComplete)
      Subscribes to the source and calls the given actions on the current thread.
      static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> o, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Action onComplete, int bufferSize)
      Subscribes to the source and calls the given actions on the current thread.
      static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> source, org.reactivestreams.Subscriber<? super T> subscriber)
      Subscribes to the source and calls the Subscriber methods on the current thread.
      • Methods inherited from class java.lang.Object

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

      • FlowableBlockingSubscribe

        private FlowableBlockingSubscribe()
        Utility class.
    • Method Detail

      • subscribe

        public static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> source,
                                         org.reactivestreams.Subscriber<? super T> subscriber)
        Subscribes to the source and calls the Subscriber methods on the current thread.

        Type Parameters:
        T - the value type
        Parameters:
        source - the source publisher The cancellation and backpressure is composed through.
        subscriber - the subscriber to forward events and calls to in the current thread
      • subscribe

        public static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> source)
        Runs the source observable to a terminal event, ignoring any values and rethrowing any exception.
        Type Parameters:
        T - the value type
        Parameters:
        source - the source to await
      • subscribe

        public static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> o,
                                         Consumer<? super T> onNext,
                                         Consumer<? super java.lang.Throwable> onError,
                                         Action onComplete)
        Subscribes to the source and calls the given actions on the current thread.
        Type Parameters:
        T - the value type
        Parameters:
        o - the source publisher
        onNext - the callback action for each source value
        onError - the callback action for an error event
        onComplete - the callback action for the completion event.
      • subscribe

        public static <T> void subscribe​(org.reactivestreams.Publisher<? extends T> o,
                                         Consumer<? super T> onNext,
                                         Consumer<? super java.lang.Throwable> onError,
                                         Action onComplete,
                                         int bufferSize)
        Subscribes to the source and calls the given actions on the current thread.
        Type Parameters:
        T - the value type
        Parameters:
        o - the source publisher
        onNext - the callback action for each source value
        onError - the callback action for an error event
        onComplete - the callback action for the completion event.
        bufferSize - the number of elements to prefetch from the source Publisher