Class OnSubscribeToObservableFuture


  • public final class OnSubscribeToObservableFuture
    extends java.lang.Object
    Converts a Future into an Observable.

    You can convert any object that supports the Future interface into an Observable that emits the return value of the get method of that object, by using this operator.

    This is blocking so the Subscription returned when calling Observable.unsafeSubscribe(Observer) does nothing.

    • Constructor Detail

      • OnSubscribeToObservableFuture

        private OnSubscribeToObservableFuture()
    • Method Detail

      • toObservableFuture

        public static <T> Observable.OnSubscribe<T> toObservableFuture​(java.util.concurrent.Future<? extends T> that)
      • toObservableFuture

        public static <T> Observable.OnSubscribe<T> toObservableFuture​(java.util.concurrent.Future<? extends T> that,
                                                                       long time,
                                                                       java.util.concurrent.TimeUnit unit)