Class AsyncFlowable


  • public final class AsyncFlowable
    extends java.lang.Object
    Utility methods to convert functions and actions into asynchronous operations through the Publisher/Subscriber pattern.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> Flowable<T> deferFuture​(Supplier<? extends java.util.concurrent.Future<? extends Publisher<? extends T>>> publisherFactoryAsync)
      Returns an Observable that starts the specified asynchronous factory function whenever a new subscriber subscribes.
      static <T> Flowable<T> deferFuture​(Supplier<? extends java.util.concurrent.Future<? extends Publisher<? extends T>>> publisherFactoryAsync, Scheduler scheduler)
      Returns an Observable that starts the specified asynchronous factory function whenever a new subscriber subscribes.
      static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source, Consumer<? super T> onNext)
      Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future.
      static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source, Consumer<? super T> onNext, Scheduler scheduler)
      Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future, scheduled on the given scheduler.
      static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError)
      Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future.
      static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Scheduler scheduler)
      Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future, scheduled on the given Scheduler.
      static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Action onComplete)
      Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future.
      static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source, Consumer<? super T> onNext, Consumer<? super java.lang.Throwable> onError, Action onComplete, Scheduler scheduler)
      Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future, scheduled on the given Scheduler.
      static <T> DisposableFlowable<T> runAsync​(Scheduler scheduler, BiConsumer<? super Subscriber<? super T>,​? super Disposable> action)
      Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned DisposableFlowable.
      static <T,​U>
      DisposableFlowable<U>
      runAsync​(Scheduler scheduler, Processor<T,​U> processor, BiConsumer<? super Subscriber<? super T>,​? super Disposable> action)
      Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned DisposableFlowable.
      static <T> Flowable<T> start​(Supplier<? extends T> func)
      Invokes the specified function asynchronously and returns an Flowable that emits the result.
      static <T> Flowable<T> start​(Supplier<? extends T> func, Scheduler scheduler)
      Invokes the specified function asynchronously on the specified Scheduler and returns an Flowable that emits the result.
      static <T> Flowable<T> startFuture​(Supplier<? extends java.util.concurrent.Future<? extends T>> functionAsync)
      Invokes the asynchronous function immediately, surfacing the result through an Observable.
      static <T> Flowable<T> startFuture​(Supplier<? extends java.util.concurrent.Future<? extends T>> functionAsync, Scheduler scheduler)
      Invokes the asynchronous function immediately, surfacing the result through an Observable and waits on the specified Scheduler.
      static <T1,​T2,​T3>
      PlainFunction3<T1,​T2,​T3,​Flowable<java.lang.Object>>
      toAsync​(Consumer3<? super T1,​? super T2,​? super T3> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3>
      PlainFunction3<T1,​T2,​T3,​Flowable<java.lang.Object>>
      toAsync​(Consumer3<? super T1,​? super T2,​? super T3> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4>
      PlainFunction4<T1,​T2,​T3,​T4,​Flowable<java.lang.Object>>
      toAsync​(Consumer4<? super T1,​? super T2,​? super T3,​? super T4> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4>
      PlainFunction4<T1,​T2,​T3,​T4,​Flowable<java.lang.Object>>
      toAsync​(Consumer4<? super T1,​? super T2,​? super T3,​? super T4> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5>
      PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<java.lang.Object>>
      toAsync​(Consumer5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5>
      PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<java.lang.Object>>
      toAsync​(Consumer5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6>
      PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<java.lang.Object>>
      toAsync​(Consumer6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6>
      PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<java.lang.Object>>
      toAsync​(Consumer6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7>
      PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<java.lang.Object>>
      toAsync​(Consumer7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7>
      PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<java.lang.Object>>
      toAsync​(Consumer7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8>
      PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<java.lang.Object>>
      toAsync​(Consumer8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8>
      PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<java.lang.Object>>
      toAsync​(Consumer8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9>
      PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<java.lang.Object>>
      toAsync​(Consumer9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9>
      PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<java.lang.Object>>
      toAsync​(Consumer9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static SimpleCallable<Flowable<java.lang.Object>> toAsync​(Action action)
      Convert a synchronous action call into an asynchronous function call through a Flowable.
      static SimpleCallable<Flowable<java.lang.Object>> toAsync​(Action action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through a Flowable.
      static <T1,​T2>
      PlainBiFunction<T1,​T2,​Flowable<java.lang.Object>>
      toAsync​(BiConsumer<? super T1,​? super T2> action)
      Convert a synchronous action call into an asynchronous function call through a Flowable.
      static <T1,​T2>
      PlainBiFunction<T1,​T2,​Flowable<java.lang.Object>>
      toAsync​(BiConsumer<? super T1,​? super T2> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through a Flowable.
      static <T1,​T2,​R>
      PlainBiFunction<T1,​T2,​Flowable<R>>
      toAsync​(BiFunction<? super T1,​? super T2,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <T1,​T2,​R>
      PlainBiFunction<T1,​T2,​Flowable<R>>
      toAsync​(BiFunction<? super T1,​? super T2,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <T1> PlainFunction<T1,​Flowable<java.lang.Object>> toAsync​(Consumer<? super T1> action)
      Convert a synchronous action call into an asynchronous function call through a Flowable.
      static <T1> PlainFunction<T1,​Flowable<java.lang.Object>> toAsync​(Consumer<? super T1> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through a Flowable.
      static <T1,​R>
      PlainFunction<T1,​Flowable<R>>
      toAsync​(Function<? super T1,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <T1,​R>
      PlainFunction<T1,​Flowable<R>>
      toAsync​(Function<? super T1,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <T1,​T2,​T3,​R>
      PlainFunction3<T1,​T2,​T3,​Flowable<R>>
      toAsync​(Function3<? super T1,​? super T2,​? super T3,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​R>
      PlainFunction3<T1,​T2,​T3,​Flowable<R>>
      toAsync​(Function3<? super T1,​? super T2,​? super T3,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​R>
      PlainFunction4<T1,​T2,​T3,​T4,​Flowable<R>>
      toAsync​(Function4<? super T1,​? super T2,​? super T3,​? super T4,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​R>
      PlainFunction4<T1,​T2,​T3,​T4,​Flowable<R>>
      toAsync​(Function4<? super T1,​? super T2,​? super T3,​? super T4,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​R>
      PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<R>>
      toAsync​(Function5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​R>
      PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<R>>
      toAsync​(Function5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​R>
      PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<R>>
      toAsync​(Function6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​R>
      PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<R>>
      toAsync​(Function6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​R>
      PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<R>>
      toAsync​(Function7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​R>
      PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<R>>
      toAsync​(Function7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R>
      PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<R>>
      toAsync​(Function8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R>
      PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<R>>
      toAsync​(Function8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R>
      PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<R>>
      toAsync​(Function9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9,​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R>
      PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<R>>
      toAsync​(Function9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9,​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static PlainFunction<java.lang.Object[],​Flowable<java.lang.Object>> toAsyncArray​(Consumer<? super java.lang.Object[]> action)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static PlainFunction<java.lang.Object[],​Flowable<java.lang.Object>> toAsyncArray​(Consumer<? super java.lang.Object[]> action, Scheduler scheduler)
      Convert a synchronous action call into an asynchronous function call through an Flowable.
      static <R> PlainFunction<java.lang.Object[],​Flowable<R>> toAsyncArray​(Function<? super java.lang.Object[],​? extends R> func)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <R> PlainFunction<java.lang.Object[],​Flowable<R>> toAsyncArray​(Function<? super java.lang.Object[],​? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through an Flowable.
      static <R> SimpleCallable<Flowable<R>> toAsyncCallable​(java.util.concurrent.Callable<? extends R> func)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <R> SimpleCallable<Flowable<R>> toAsyncCallable​(java.util.concurrent.Callable<? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <R> SimpleCallable<Flowable<R>> toAsyncSupplier​(Supplier<? extends R> func)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      static <R> SimpleCallable<Flowable<R>> toAsyncSupplier​(Supplier<? extends R> func, Scheduler scheduler)
      Convert a synchronous function call into an asynchronous function call through a Flowable.
      • Methods inherited from class java.lang.Object

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

      • start

        public static <T> Flowable<T> start​(Supplier<? extends T> func)
        Invokes the specified function asynchronously and returns an Flowable that emits the result.

        Note: The function is called immediately and once, not whenever an observer subscribes to the resulting Flowable. Multiple subscriptions to this Flowable observe the same return value.

        Backpressure:
        The returned Flowable honors downstream backpressure.
        Scheduler:
        start by default operates on the computation Scheduler.
        Type Parameters:
        T - the result value type
        Parameters:
        func - function to run asynchronously
        Returns:
        an Flowable that emits the function's result value, or notifies observers of an exception
        See Also:
        RxJava Wiki: start(), MSDN: Observable.Start
      • start

        public static <T> Flowable<T> start​(Supplier<? extends T> func,
                                            Scheduler scheduler)
        Invokes the specified function asynchronously on the specified Scheduler and returns an Flowable that emits the result.

        Note: The function is called immediately and once, not whenever an observer subscribes to the resulting Flowable. Multiple subscriptions to this Flowable observe the same return value.

        Backpressure:
        The returned Flowable honors downstream backpressure.
        Scheduler:
        You specify the Scheduler start works on.

        Type Parameters:
        T - the result value type
        Parameters:
        func - function to run asynchronously
        scheduler - Scheduler to run the function on
        Returns:
        an Flowable that emits the function's result value, or notifies observers of an exception
        See Also:
        RxJava Wiki: start(), MSDN: Observable.Start
      • toAsync

        public static SimpleCallable<Flowable<java.lang.Object>> toAsync​(Action action)
        Convert a synchronous action call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the SimpleCallable honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsyncCallable

        public static <R> SimpleCallable<Flowable<R>> toAsyncCallable​(java.util.concurrent.Callable<? extends R> func)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the SimpleCallable honors downstream backpressure.
        Scheduler:
        toAsyncCallable by default operates on the computation Scheduler.
        Type Parameters:
        R - the result value type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsyncSupplier

        public static <R> SimpleCallable<Flowable<R>> toAsyncSupplier​(Supplier<? extends R> func)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the SimpleCallable honors downstream backpressure.
        Scheduler:
        toAsyncSupplier by default operates on the computation Scheduler.
        Type Parameters:
        R - the result value type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1> PlainFunction<T1,​Flowable<java.lang.Object>> toAsync​(Consumer<? super T1> action)
        Convert a synchronous action call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - first parameter type of the action
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​R> PlainFunction<T1,​Flowable<R>> toAsync​(Function<? super T1,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - first parameter type of the action
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2> PlainBiFunction<T1,​T2,​Flowable<java.lang.Object>> toAsync​(BiConsumer<? super T1,​? super T2> action)
        Convert a synchronous action call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns a Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​R> PlainBiFunction<T1,​T2,​Flowable<R>> toAsync​(BiFunction<? super T1,​? super T2,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns a Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3> PlainFunction3<T1,​T2,​T3,​Flowable<java.lang.Object>> toAsync​(Consumer3<? super T1,​? super T2,​? super T3> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​R> PlainFunction3<T1,​T2,​T3,​Flowable<R>> toAsync​(Function3<? super T1,​? super T2,​? super T3,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4> PlainFunction4<T1,​T2,​T3,​T4,​Flowable<java.lang.Object>> toAsync​(Consumer4<? super T1,​? super T2,​? super T3,​? super T4> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​R> PlainFunction4<T1,​T2,​T3,​T4,​Flowable<R>> toAsync​(Function4<? super T1,​? super T2,​? super T3,​? super T4,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5> PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<java.lang.Object>> toAsync​(Consumer5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​R> PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<R>> toAsync​(Function5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6> PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<java.lang.Object>> toAsync​(Consumer6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​R> PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<R>> toAsync​(Function6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7> PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<java.lang.Object>> toAsync​(Consumer7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​R> PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<R>> toAsync​(Function7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8> PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<java.lang.Object>> toAsync​(Consumer8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R> PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<R>> toAsync​(Function8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9> PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<java.lang.Object>> toAsync​(Consumer9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        T9 - the ninth parameter type
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R> PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<R>> toAsync​(Function9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9,​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsync by default operates on the computation Scheduler.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        T9 - the ninth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsyncArray

        public static PlainFunction<java.lang.Object[],​Flowable<java.lang.Object>> toAsyncArray​(Consumer<? super java.lang.Object[]> action)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsyncArray by default operates on the computation Scheduler.
        Parameters:
        action - the action to convert
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync()
      • toAsyncArray

        public static <R> PlainFunction<java.lang.Object[],​Flowable<R>> toAsyncArray​(Function<? super java.lang.Object[],​? extends R> func)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the function honors downstream backpressure.
        Scheduler:
        toAsyncArray by default operates on the computation Scheduler.
        Type Parameters:
        R - the result type
        Parameters:
        func - the function to convert
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync()
      • toAsync

        public static SimpleCallable<Flowable<java.lang.Object>> toAsync​(Action action,
                                                                         Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the SimpleCallable honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits an Object
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsyncCallable

        public static <R> SimpleCallable<Flowable<R>> toAsyncCallable​(java.util.concurrent.Callable<? extends R> func,
                                                                      Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the SimpleCallable honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsyncCallable works on.
        Type Parameters:
        R - the result value type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsyncSupplier

        public static <R> SimpleCallable<Flowable<R>> toAsyncSupplier​(Supplier<? extends R> func,
                                                                      Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the SimpleCallable honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsyncSupplier works on.
        Type Parameters:
        R - the result value type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1> PlainFunction<T1,​Flowable<java.lang.Object>> toAsync​(Consumer<? super T1> action,
                                                                                      Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - first parameter type of the action
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​R> PlainFunction<T1,​Flowable<R>> toAsync​(Function<? super T1,​? extends R> func,
                                                                               Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - first parameter type of the action
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2> PlainBiFunction<T1,​T2,​Flowable<java.lang.Object>> toAsync​(BiConsumer<? super T1,​? super T2> action,
                                                                                                          Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns a Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​R> PlainBiFunction<T1,​T2,​Flowable<R>> toAsync​(BiFunction<? super T1,​? super T2,​? extends R> func,
                                                                                                   Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through a Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns a Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3> PlainFunction3<T1,​T2,​T3,​Flowable<java.lang.Object>> toAsync​(Consumer3<? super T1,​? super T2,​? super T3> action,
                                                                                                                           Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​R> PlainFunction3<T1,​T2,​T3,​Flowable<R>> toAsync​(Function3<? super T1,​? super T2,​? super T3,​? extends R> func,
                                                                                                                    Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4> PlainFunction4<T1,​T2,​T3,​T4,​Flowable<java.lang.Object>> toAsync​(Consumer4<? super T1,​? super T2,​? super T3,​? super T4> action,
                                                                                                                                             Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​R> PlainFunction4<T1,​T2,​T3,​T4,​Flowable<R>> toAsync​(Function4<? super T1,​? super T2,​? super T3,​? super T4,​? extends R> func,
                                                                                                                                      Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5> PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<java.lang.Object>> toAsync​(Consumer5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5> action,
                                                                                                                                                               Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​R> PlainFunction5<T1,​T2,​T3,​T4,​T5,​Flowable<R>> toAsync​(Function5<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? extends R> func,
                                                                                                                                                        Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6> PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<java.lang.Object>> toAsync​(Consumer6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6> action,
                                                                                                                                                                                 Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​R> PlainFunction6<T1,​T2,​T3,​T4,​T5,​T6,​Flowable<R>> toAsync​(Function6<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? extends R> func,
                                                                                                                                                                          Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7> PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<java.lang.Object>> toAsync​(Consumer7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7> action,
                                                                                                                                                                                                   Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​R> PlainFunction7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​Flowable<R>> toAsync​(Function7<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? extends R> func,
                                                                                                                                                                                            Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8> PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<java.lang.Object>> toAsync​(Consumer8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8> action,
                                                                                                                                                                                                                     Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R> PlainFunction8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​Flowable<R>> toAsync​(Function8<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? extends R> func,
                                                                                                                                                                                                              Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9> PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<java.lang.Object>> toAsync​(Consumer9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9> action,
                                                                                                                                                                                                                                       Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        T9 - the ninth parameter type
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsync

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R> PlainFunction9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​Flowable<R>> toAsync​(Function9<? super T1,​? super T2,​? super T3,​? super T4,​? super T5,​? super T6,​? super T7,​? super T8,​? super T9,​? extends R> func,
                                                                                                                                                                                                                                Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        T1 - the first parameter type
        T2 - the second parameter type
        T3 - the third parameter type
        T4 - the fourth parameter type
        T5 - the fifth parameter type
        T6 - the sixth parameter type
        T7 - the seventh parameter type
        T8 - the eighth parameter type
        T9 - the ninth parameter type
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync(), MSDN: Observable.ToAsync
      • toAsyncArray

        public static PlainFunction<java.lang.Object[],​Flowable<java.lang.Object>> toAsyncArray​(Consumer<? super java.lang.Object[]> action,
                                                                                                      Scheduler scheduler)
        Convert a synchronous action call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Parameters:
        action - the action to convert
        scheduler - the Scheduler used to execute the action
        Returns:
        a function that returns an Flowable that executes the action and emits null
        See Also:
        RxJava Wiki: toAsync()
      • toAsyncArray

        public static <R> PlainFunction<java.lang.Object[],​Flowable<R>> toAsyncArray​(Function<? super java.lang.Object[],​? extends R> func,
                                                                                           Scheduler scheduler)
        Convert a synchronous function call into an asynchronous function call through an Flowable.

        Backpressure:
        The Flowable returned by the Function honors downstream backpressure.
        Scheduler:
        You specify the Scheduler toAsync works on.
        Type Parameters:
        R - the result type
        Parameters:
        func - the function to convert
        scheduler - the Scheduler used to call the func
        Returns:
        a function that returns an Flowable that executes the func and emits its returned value
        See Also:
        RxJava Wiki: toAsync()
      • startFuture

        public static <T> Flowable<T> startFuture​(Supplier<? extends java.util.concurrent.Future<? extends T>> functionAsync)
        Invokes the asynchronous function immediately, surfacing the result through an Observable.

        Important note subscribing to the resulting Observable blocks until the future completes.

        Backpressure:
        The Flowable returned honors downstream backpressure.
        Scheduler:
        startFuture by default operates on the computation Scheduler.
        Type Parameters:
        T - the result type
        Parameters:
        functionAsync - the asynchronous function to run
        Returns:
        an Observable that surfaces the result of the future
        See Also:
        startFuture(Supplier, Scheduler), RxJava Wiki: startFuture()
      • startFuture

        public static <T> Flowable<T> startFuture​(Supplier<? extends java.util.concurrent.Future<? extends T>> functionAsync,
                                                  Scheduler scheduler)
        Invokes the asynchronous function immediately, surfacing the result through an Observable and waits on the specified Scheduler.

        Backpressure:
        The Flowable returned honors downstream backpressure.
        Scheduler:
        You specify the Scheduler startFuture works on.
        Type Parameters:
        T - the result type
        Parameters:
        functionAsync - the asynchronous function to run
        scheduler - the Scheduler where the completion of the Future is awaited
        Returns:
        an Observable that surfaces the result of the future
        See Also:
        RxJava Wiki: startFuture()
      • deferFuture

        public static <T> Flowable<T> deferFuture​(Supplier<? extends java.util.concurrent.Future<? extends Publisher<? extends T>>> publisherFactoryAsync)
        Returns an Observable that starts the specified asynchronous factory function whenever a new subscriber subscribes.

        Important note subscribing to the resulting Observable blocks until the future completes.

        Backpressure:
        The Flowable returned honors downstream backpressure.
        Scheduler:
        deferFuture by default operates on the computation Scheduler.
        Type Parameters:
        T - the result type
        Parameters:
        publisherFactoryAsync - the asynchronous function to start for each observer
        Returns:
        the Observable emitting items produced by the asynchronous observer produced by the factory
        See Also:
        deferFuture(Supplier, Scheduler), RxJava Wiki: deferFuture()
      • deferFuture

        public static <T> Flowable<T> deferFuture​(Supplier<? extends java.util.concurrent.Future<? extends Publisher<? extends T>>> publisherFactoryAsync,
                                                  Scheduler scheduler)
        Returns an Observable that starts the specified asynchronous factory function whenever a new subscriber subscribes.

        Backpressure:
        The Flowable returned honors downstream backpressure.
        Scheduler:
        You specify the Scheduler deferFuture works on.
        Type Parameters:
        T - the result type
        Parameters:
        publisherFactoryAsync - the asynchronous function to start for each observer
        scheduler - the Scheduler where the completion of the Future is awaited
        Returns:
        the Observable emitting items produced by the asynchronous observer produced by the factory
        See Also:
        RxJava Wiki: deferFuture()
      • forEachFuture

        public static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source,
                                                                                      Consumer<? super T> onNext)
        Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future.

        Important note: The returned task blocks indefinitely unless the run() method is called or the task is scheduled on an Executor.

        Backpressure:
        The input Publisher is consumed in an unbounded manner.
        Scheduler:
        forEachFuture by default operates on the computation Scheduler.
        Type Parameters:
        T - the source value type
        Parameters:
        source - the source Observable
        onNext - the action to call with each emitted element
        Returns:
        the Future representing the entire for-each operation
        See Also:
        forEachFuture(Publisher, Consumer, Scheduler), RxJava Wiki: forEachFuture()
      • forEachFuture

        public static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source,
                                                                                      Consumer<? super T> onNext,
                                                                                      Consumer<? super java.lang.Throwable> onError)
        Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future.

        Important note: The returned task blocks indefinitely unless the run() method is called or the task is scheduled on an Executor.

        Backpressure:
        The input Publisher is consumed in an unbounded manner.
        Scheduler:
        forEachFuture by default operates on the computation Scheduler.
        Type Parameters:
        T - the source value type
        Parameters:
        source - the source Observable
        onNext - the action to call with each emitted element
        onError - the action to call when an exception is emitted
        Returns:
        the Future representing the entire for-each operation
        See Also:
        forEachFuture(Publisher, Consumer, Consumer, Scheduler), RxJava Wiki: forEachFuture()
      • forEachFuture

        public static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source,
                                                                                      Consumer<? super T> onNext,
                                                                                      Consumer<? super java.lang.Throwable> onError,
                                                                                      Action onComplete)
        Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future.

        Important note: The returned task blocks indefinitely unless the run() method is called or the task is scheduled on an Executor.

        Backpressure:
        The input Publisher is consumed in an unbounded manner.
        Scheduler:
        forEachFuture by default operates on the computation Scheduler.
        Type Parameters:
        T - the source value type
        Parameters:
        source - the source Observable
        onNext - the action to call with each emitted element
        onError - the action to call when an exception is emitted
        onComplete - the action to call when the source completes
        Returns:
        the Future representing the entire for-each operation
        See Also:
        forEachFuture(Publisher, Consumer, Consumer, Action, Scheduler), RxJava Wiki: forEachFuture()
      • forEachFuture

        public static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source,
                                                                                      Consumer<? super T> onNext,
                                                                                      Scheduler scheduler)
        Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future, scheduled on the given scheduler.

        Backpressure:
        The input Publisher is consumed in an unbounded manner.
        Scheduler:
        You specify the Scheduler forEachFuture works on.
        Type Parameters:
        T - the source value type
        Parameters:
        source - the source Observable
        onNext - the action to call with each emitted element
        scheduler - the Scheduler where the task will await the termination of the for-each
        Returns:
        the Future representing the entire for-each operation
        See Also:
        RxJava Wiki: forEachFuture()
      • forEachFuture

        public static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source,
                                                                                      Consumer<? super T> onNext,
                                                                                      Consumer<? super java.lang.Throwable> onError,
                                                                                      Scheduler scheduler)
        Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future, scheduled on the given Scheduler.

        Backpressure:
        The input Publisher is consumed in an unbounded manner.
        Scheduler:
        You specify the Scheduler forEachFuture works on.
        Type Parameters:
        T - the source value type
        Parameters:
        source - the source Observable
        onNext - the action to call with each emitted element
        onError - the action to call when an exception is emitted
        scheduler - the Scheduler where the task will await the termination of the for-each
        Returns:
        the Future representing the entire for-each operation
        See Also:
        RxJava Wiki: forEachFuture()
      • forEachFuture

        public static <T> java.util.concurrent.Future<java.lang.Object> forEachFuture​(Publisher<? extends T> source,
                                                                                      Consumer<? super T> onNext,
                                                                                      Consumer<? super java.lang.Throwable> onError,
                                                                                      Action onComplete,
                                                                                      Scheduler scheduler)
        Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion or error through a Future, scheduled on the given Scheduler.

        Backpressure:
        The input Publisher is consumed in an unbounded manner.
        Scheduler:
        You specify the Scheduler forEachFuture works on.
        Type Parameters:
        T - the source value type
        Parameters:
        source - the source Observable
        onNext - the action to call with each emitted element
        onError - the action to call when an exception is emitted
        onComplete - the action to call when the source completes
        scheduler - the Scheduler where the task will await the termination of the for-each
        Returns:
        the Future representing the entire for-each operation
        See Also:
        RxJava Wiki: forEachFuture()
      • runAsync

        public static <T> DisposableFlowable<T> runAsync​(Scheduler scheduler,
                                                         BiConsumer<? super Subscriber<? super T>,​? super Disposable> action)
        Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned DisposableFlowable. The action is immediately executed and unobserved values will be lost.
        Backpressure:
        The resulting Flowable signals MissingBackpressureException if the downstream can't keep up.
        Scheduler:
        You specify the Scheduler forEachFuture works on.
        Type Parameters:
        T - the output value type
        Parameters:
        scheduler - the Scheduler where the action is executed
        action - the action to execute, receives a Subscriber where the events can be pumped and a Disposable which lets it check for cancellation condition
        Returns:
        an DisposableFlowable that provides a Disposable interface to cancel the action
        See Also:
        RxJava Wiki: runAsync()
      • runAsync

        public static <T,​U> DisposableFlowable<U> runAsync​(Scheduler scheduler,
                                                                 Processor<T,​U> processor,
                                                                 BiConsumer<? super Subscriber<? super T>,​? super Disposable> action)
        Runs the provided action on the given scheduler and allows propagation of multiple events to the observers of the returned DisposableFlowable. The action is immediately executed and unobserved values might be lost, depending on the Subject type used.
        Backpressure:
        The provided Processor's backpressure behavior determines the returned Flowable's backpressure behavior.
        Scheduler:
        You specify the Scheduler forEachFuture works on.
        Type Parameters:
        T - the output value of the action
        U - the output type of the observable sequence
        Parameters:
        scheduler - the Scheduler where the action is executed
        processor - the subject to use to distribute values emitted by the action
        action - the action to execute, receives a Subscriber where the events can be pumped and a Disposable which lets it check for cancellation condition
        Returns:
        an DisposableFlowable that provides a Disposable interface to cancel the action
        See Also:
        RxJava Wiki: runAsync()