public class ListenableFutureObservable
extends java.lang.Object
| Constructor and Description |
|---|
ListenableFutureObservable() |
| Modifier and Type | Method and Description |
|---|---|
static <T> rx.Observable<T> |
from(com.google.common.util.concurrent.ListenableFuture<T> future,
java.util.concurrent.Executor executor)
Converts from
ListenableFuture to Observable. |
static <T> rx.Observable<T> |
from(com.google.common.util.concurrent.ListenableFuture<T> future,
rx.Scheduler scheduler)
Converts from
ListenableFuture to Observable. |
static <T> com.google.common.util.concurrent.ListenableFuture<T> |
to(rx.Observable<T> observable)
Immediately subscribes to the
Observable and returns a future that will contain the only one value T passed in to the
Observer.onNext(Object). |
public static <T> rx.Observable<T> from(com.google.common.util.concurrent.ListenableFuture<T> future,
rx.Scheduler scheduler)
ListenableFuture to Observable.future - the ListenableFuture to register a listener on.scheduler - the Scheduler where the callback will be executed. The will be where the Observer.onNext(Object) call from.Observable that emits the one value when the future completes.public static <T> rx.Observable<T> from(com.google.common.util.concurrent.ListenableFuture<T> future,
java.util.concurrent.Executor executor)
ListenableFuture to Observable.future - the ListenableFuture to register a listener on.executor - the Executor where the callback will be executed. The will be where the Observer.onNext(Object) call from.Observable that emits the one value when the future completes.public static <T> com.google.common.util.concurrent.ListenableFuture<T> to(rx.Observable<T> observable)
Observable and returns a future that will contain the only one value T passed in to the
Observer.onNext(Object). If more than one value is received then an Observer.onError(Throwable) is invoked.
If the source Observable emits more than one item or no items, notify of an IllegalArgumentException or NoSuchElementException respectively.
observable - The source Observable for the value.ListenableFuture that sets the value on completion.