Package rx.singles
Class BlockingSingle<T>
- java.lang.Object
-
- rx.singles.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" ofSingle
that provides blocking operators. You construct aBlockingSingle
from aSingle
withfrom(Single)
orSingle.toBlocking()
.- Since:
- (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
-
-
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 aSingle
into aBlockingSingle
.java.util.concurrent.Future<T>
toFuture()
Returns aFuture
representing the value emitted by thisBlockingSingle
.T
value()
Returns the item emitted by thisBlockingSingle
.
-
-
-
Method Detail
-
from
@Experimental public static <T> BlockingSingle<T> from(Single<? extends T> single)
Converts aSingle
into aBlockingSingle
.- Type Parameters:
T
- the value type of the sequence- Parameters:
single
- theSingle
you want to convert- Returns:
- a
BlockingSingle
version ofsingle
-
value
@Experimental public T value()
Returns the item emitted by thisBlockingSingle
. If the underlyingSingle
returns successfully, the value emitted by theSingle
is returned. If theSingle
emits an error, the throwable emitted (SingleSubscriber.onError(Throwable)
) is thrown.- Returns:
- the value emitted by this
BlockingSingle
-
toFuture
@Experimental public java.util.concurrent.Future<T> toFuture()
Returns aFuture
representing the value emitted by thisBlockingSingle
.- Returns:
- a
Future
that returns the value
-
-