@Experimental public class RxQuery<T> extends java.lang.Object
Query
results in Rx fashion.Modifier and Type | Field and Description |
---|---|
protected rx.Scheduler |
scheduler |
Constructor and Description |
---|
RxQuery(Query<T> query) |
RxQuery(Query<T> query,
rx.Scheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
rx.Scheduler |
getScheduler()
The default scheduler (or null) used for wrapping.
|
rx.Observable<java.util.List<T>> |
list()
Rx version of
Query.list() returning an Observable. |
rx.Observable<T> |
oneByOne()
Emits the resulting entities one by one, producing them on the fly ("streaming" entities).
|
rx.Observable<T> |
unique()
Rx version of
Query.unique() returning an Observable. |
protected <R> rx.Observable<R> |
wrap(java.util.concurrent.Callable<R> callable) |
protected <R> rx.Observable<R> |
wrap(rx.Observable<R> observable) |
@Experimental public rx.Observable<java.util.List<T>> list()
Query.list()
returning an Observable.@Experimental public rx.Observable<T> unique()
Query.unique()
returning an Observable.public rx.Observable<T> oneByOne()
list()
, it does not wait for the query to gather all results. Thus, the first entities are
immediately available as soon the underlying database cursor has data. This approach may be more memory
efficient for large number of entities (or large entities) at the cost of additional overhead caused by a
per-entity delivery through Rx.@Experimental public rx.Scheduler getScheduler()
protected <R> rx.Observable<R> wrap(java.util.concurrent.Callable<R> callable)
protected <R> rx.Observable<R> wrap(rx.Observable<R> observable)
Available under the Apache License, Version 2.0 - Copyright © 2011-2016 greenrobot.org. All Rights Reserved.