Package rx.singles

Class BlockingSingle<T>

  • Type Parameters:
    T - the value type of the sequence

    @Experimental
    public final class BlockingSingle<T>
    extends java.lang.Object
    BlockingSingle is a blocking "version" of Single that provides blocking operators.

    You construct a BlockingSingle from a Single with from(Single) or Single.toBlocking().

    Since:
    (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Single<? extends T> single  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BlockingSingle​(Single<? extends T> single)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> BlockingSingle<T> from​(Single<? extends T> single)
      Converts a Single into a BlockingSingle.
      java.util.concurrent.Future<T> toFuture()
      Returns a Future representing the value emitted by this BlockingSingle.
      T value()
      Returns the item emitted by this BlockingSingle.
      • Methods inherited from class java.lang.Object

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

      • single

        private final Single<? extends T> single
    • Constructor Detail

      • BlockingSingle

        private BlockingSingle​(Single<? extends T> single)
    • Method Detail

      • from

        @Experimental
        public static <T> BlockingSingle<T> from​(Single<? extends T> single)
        Converts a Single into a BlockingSingle.
        Type Parameters:
        T - the value type of the sequence
        Parameters:
        single - the Single you want to convert
        Returns:
        a BlockingSingle version of single
      • toFuture

        @Experimental
        public java.util.concurrent.Future<T> toFuture()
        Returns a Future representing the value emitted by this BlockingSingle.
        Returns:
        a Future that returns the value