public final class Obs extends Object
Constructor and Description |
---|
Obs() |
Modifier and Type | Method and Description |
---|---|
static <T> CachedObservable<T> |
cache(rx.Observable<T> source)
Returns a cached
Observable like Observable.cache()
except that the cache can be reset by calling
CachedObservable.reset() . |
static <T> rx.Observable<T> |
cache(rx.Observable<T> source,
long duration,
TimeUnit unit,
rx.Scheduler.Worker worker)
Returns a cached
Observable like Observable.cache()
except that the cache can be reset by calling
CachedObservable.reset() and the cache will be automatically
reset an interval after first subscription (or first subscription after
reset). |
static <T> CloseableObservableWithReset<T> |
cache(rx.Observable<T> source,
long duration,
TimeUnit unit,
rx.Scheduler scheduler)
Returns a cached
Observable like Observable.cache()
except that the cache may be reset by the user calling
CloseableObservableWithReset.reset() . |
static <T extends Comparable<? super T>> |
create(Collection<rx.Observable<T>> sources) |
static <T extends Comparable<? super T>> |
create(Collection<rx.Observable<T>> sources,
boolean delayErrors) |
static <T> rx.Observable<T> |
create(Collection<rx.Observable<T>> sources,
Comparator<? super T> comparator) |
static <T> rx.Observable<T> |
create(Collection<rx.Observable<T>> sources,
Comparator<? super T> comparator,
boolean delayErrors) |
static <T> rx.Observable<T> |
fromQueue(Queue<T> queue) |
static rx.Observable<Long> |
intervalLong(long duration,
TimeUnit unit) |
static rx.Observable<Long> |
intervalLong(long duration,
TimeUnit unit,
rx.Scheduler scheduler) |
static <T> rx.Observable<List<Integer>> |
permutations(int size) |
static <T> rx.Observable<List<T>> |
permutations(List<T> list) |
static <T> rx.Observable<T> |
repeating(T t)
Returns an Observable that epeats emitting
t without completing. |
public static <T> CachedObservable<T> cache(rx.Observable<T> source)
Observable
like Observable.cache()
except that the cache can be reset by calling
CachedObservable.reset()
.T
- the generic type of the sourcesource
- the observable to be cached.public static <T> rx.Observable<T> cache(rx.Observable<T> source, long duration, TimeUnit unit, rx.Scheduler.Worker worker)
Observable
like Observable.cache()
except that the cache can be reset by calling
CachedObservable.reset()
and the cache will be automatically
reset an interval after first subscription (or first subscription after
reset). The interval is defined by duration
and unit
.T
- the generic type of the sourcesource
- the source observableduration
- duration till next resetunit
- units corresponding to the durationworker
- worker to use for scheduling reset. Don't forget to
unsubscribe the worker when no longer required.public static <T> CloseableObservableWithReset<T> cache(rx.Observable<T> source, long duration, TimeUnit unit, rx.Scheduler scheduler)
Observable
like Observable.cache()
except that the cache may be reset by the user calling
CloseableObservableWithReset.reset()
.T
- generic type of source observablesource
- the source observableduration
- duration till next resetunit
- units corresponding to the durationscheduler
- scheduler to use for scheduling reset.CloseableObservableWithReset
that should be closed once
finished to prevent worker memory leak.public static <T> rx.Observable<T> repeating(T t)
t
without completing.
Supports backpressure.T
- type of tt
- value to repeatpublic static <T extends Comparable<? super T>> rx.Observable<T> create(Collection<rx.Observable<T>> sources)
public static <T> rx.Observable<T> create(Collection<rx.Observable<T>> sources, Comparator<? super T> comparator)
public static <T extends Comparable<? super T>> rx.Observable<T> create(Collection<rx.Observable<T>> sources, boolean delayErrors)
public static <T> rx.Observable<T> create(Collection<rx.Observable<T>> sources, Comparator<? super T> comparator, boolean delayErrors)
public static <T> rx.Observable<T> fromQueue(Queue<T> queue)
public static rx.Observable<Long> intervalLong(long duration, TimeUnit unit, rx.Scheduler scheduler)
Copyright © 2013–2016. All rights reserved.