Top Description Fields Constructors Methods
rx.singles

public final Class BlockingSingle<T>

extends Object
Class Inheritance
Type Parameters
<T>
the value type of the sequence
Imports
java.util.concurrent.*, java.util.concurrent.atomic.AtomicReference, rx.*, rx.exceptions.Exceptions, rx.internal.operators.BlockingOperatorToFuture, rx.internal.util.BlockingUtils

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
1.3

Field Summary

Modifier and TypeField and Description
private final Single<? extends T>

Constructor Summary

AccessConstructor and Description
private
BlockingSingle(Single<? extends T> single)

Method Summary

Modifier and TypeMethod and Description
public static <
the value type of the sequence
T
>
BlockingSingle<T>

Returns:

a BlockingSingle version of single
from
(Single<? extends T>
the Single you want to convert
single
)

Converts a Single into a BlockingSingle.

public Future<T>

Returns:

a Future that returns the value
toFuture
()

Returns a Future representing the value emitted by this BlockingSingle.

public T

Returns:

the value emitted by this BlockingSingle
value
()

Returns the item emitted by this BlockingSingle.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

singleback to summary
private final Single<? extends T> single

Constructor Detail

BlockingSingleback to summary
private BlockingSingle(Single<? extends T> single)

Method Detail

fromback to summary
public static <T> BlockingSingle<T> from(Single<? extends T> single)

Converts a Single into a BlockingSingle.

Parameters
<T>
the value type of the sequence
single:Single<? extends T>

the Single you want to convert

Returns:BlockingSingle<T>

a BlockingSingle version of single

toFutureback to summary
public Future<T> toFuture()

Returns a Future representing the value emitted by this BlockingSingle.

Returns:Future<T>

a Future that returns the value

Annotations
@SuppressWarnings:unchecked
valueback to summary
public T value()

Returns the item emitted by this BlockingSingle.

If the underlying Single returns successfully, the value emitted by the Single is returned. If the Single emits an error, the throwable emitted (SingleSubscriber#onError(Throwable)) is thrown.

Returns:T

the value emitted by this BlockingSingle