-
public final class ScalarSynchronousObservable<T> extends Observable<T>
An Observable that emits a single constant scalar value to Subscribers.
This is a direct implementation of the Observable class to allow identifying it in flatMap and bypass the subscription to it altogether.
-
-
Method Summary
Modifier and Type Method Description static <T> ScalarSynchronousObservable<T>
create(T t)
Constructs a ScalarSynchronousObservable with the given constant value. T
get()
Returns the scalar constant value directly. Observable<T>
scalarScheduleOn(Scheduler scheduler)
Customized observeOn/subscribeOn implementation which emits the scalarvalue directly or with less overhead on the specified scheduler. <R> Observable<R>
scalarFlatMap(Func1<out Object, out Observable<out R>> func)
Given this scalar source as input to a flatMap, avoid one step of subscriptionand subscribes to the single Observable returned by the function. -
Methods inherited from class com.tds.common.reactor.Observable
create, debounce, doOnError, empty, error, filter, flatMap, from, from, just, just, just, just, just, lift, map, merge, observeOn, observeOn, observeOn, onErrorResumeNext, subscribe, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeOn, subscribeOn, timeout, timeout, toList, unsafeCreate, unsafeSubscribe
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
create
static <T> ScalarSynchronousObservable<T> create(T t)
Constructs a ScalarSynchronousObservable with the given constant value.
- Parameters:
t
- the value to emit when requested
-
scalarScheduleOn
Observable<T> scalarScheduleOn(Scheduler scheduler)
Customized observeOn/subscribeOn implementation which emits the scalarvalue directly or with less overhead on the specified scheduler.
- Parameters:
scheduler
- the target scheduler
-
scalarFlatMap
<R> Observable<R> scalarFlatMap(Func1<out Object, out Observable<out R>> func)
Given this scalar source as input to a flatMap, avoid one step of subscriptionand subscribes to the single Observable returned by the function.
If the functions returns another scalar, no subscription happens and this innerscalar value will be emitted once requested.
- Parameters:
func
- the mapper function that returns an Observable for the scalar value of this
-
-
-
-