Class RxQuery<T>


  • @Experimental
    public class RxQuery<T>
    extends java.lang.Object
    Gets Query results in Rx fashion.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected rx.Scheduler scheduler  
    • Constructor Summary

      Constructors 
      Constructor Description
      RxQuery​(Query<T> query)  
      RxQuery​(Query<T> query, rx.Scheduler scheduler)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • scheduler

        protected final rx.Scheduler scheduler
    • Constructor Detail

      • RxQuery

        public RxQuery​(Query<T> query)
      • RxQuery

        public RxQuery​(Query<T> query,
                       rx.Scheduler scheduler)
    • Method Detail

      • oneByOne

        public rx.Observable<T> oneByOne()
        Emits the resulting entities one by one, producing them on the fly ("streaming" entities). Unlike 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.
      • getScheduler

        @Experimental
        public rx.Scheduler getScheduler()
        The default scheduler (or null) used for wrapping.
      • wrap

        protected <R> rx.Observable<R> wrap​(java.util.concurrent.Callable<R> callable)
      • wrap

        protected <R> rx.Observable<R> wrap​(rx.Observable<R> observable)