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
BlockingSingleis a blocking "version" ofSinglethat provides blocking operators. You construct aBlockingSinglefrom aSinglewithfrom(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 privateBlockingSingle(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 aSingleinto aBlockingSingle.java.util.concurrent.Future<T>toFuture()Returns aFuturerepresenting the value emitted by thisBlockingSingle.Tvalue()Returns the item emitted by thisBlockingSingle.
-
-
-
Method Detail
-
from
@Experimental public static <T> BlockingSingle<T> from(Single<? extends T> single)
Converts aSingleinto aBlockingSingle.- Type Parameters:
T- the value type of the sequence- Parameters:
single- theSingleyou want to convert- Returns:
- a
BlockingSingleversion ofsingle
-
value
@Experimental public T value()
Returns the item emitted by thisBlockingSingle. If the underlyingSinglereturns successfully, the value emitted by theSingleis returned. If theSingleemits 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 aFuturerepresenting the value emitted by thisBlockingSingle.- Returns:
- a
Futurethat returns the value
-
-