T - generic typepublic class ObservableFactory<T>
extends java.lang.Object
Observable instances.
Typical use case for this class is to help in creating the first
Observable in a chain.
RiotApi.Champion champInterface = factory.newChampionInterface(region, true);
ObservableFactory.create(() -> {
return champInterface.getChampions(true);
})
.subscribe((ChampionListDto dto) -> {
... Process champions ...
},
(Throwable e) -> {
e.printStackTrace();
},
() -> {
System.out.println("Done");
});
| Modifier and Type | Method and Description |
|---|---|
static <T> rx.Observable<T> |
create(java.util.concurrent.Callable<T> callable) |
public static <T> rx.Observable<T> create(java.util.concurrent.Callable<T> callable)
T - generic typecallable - Callable that should make a single API call
and return the result. We use Callable instead of Supplier for the exception handling.Observable that will emit the object returned by callable