Class BlockingOperatorToFuture

java.lang.Object
rx.internal.operators.BlockingOperatorToFuture

public final class BlockingOperatorToFuture extends Object
Returns a Future representing the single value emitted by an Observable.

The toFuture operation throws an exception if the Observable emits more than one item. If the Observable may emit more than item, use toList().toFuture().

  • Constructor Details

    • BlockingOperatorToFuture

      private BlockingOperatorToFuture()
  • Method Details

    • toFuture

      public static <T> Future<T> toFuture(Observable<? extends T> that)
      Returns a Future that expects a single item from the observable.
      Type Parameters:
      T - the type of source.
      Parameters:
      that - an observable sequence to get a Future for.
      Returns:
      the Future to retrieve a single elements from an Observable