This is a direct implementation of the Observable class to allow identifying it in flatMap and bypass the subscription to it altogether.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ScalarSynchronousObservable.JustOnSubscribe<T>
The OnSubscribe callback for the Observable constructor. |
| pack-priv static class | ScalarSynchronousObservable.ScalarAsyncOnSubscribe<
the value type T>The OnSubscribe implementation that creates the ScalarAsyncProducer for each incoming subscriber. |
| pack-priv static class | ScalarSynchronousObservable.ScalarAsyncProducer<
the value type T>Represents a producer which schedules the emission of a scalar value on the first positive request via the given scheduler callback. |
| pack-priv static class | ScalarSynchronousObservable.WeakSingleProducer<
the value type T>This is the weak version of SingleProducer that uses plain fields to avoid re-entrant invocation and as such is not thread-safe for concurrent request() calls. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final boolean | STRONG_MODE
Indicates that the Producer used by this Observable should be fully thread-safe. |
| pack-priv final T | t
The constant scalar value to emit on request. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static < the value type T> ScalarSynchronousObservable | Returns: the new Observablethe value to emit when requested t)Constructs a ScalarSynchronousObservable with the given constant value. |
| pack-priv static < the type of the scalar value T> Producer | Returns: the created Producerthe target subscriber s, T the value to emit v)Creates a scalar producer depending on the state of STRONG_MODE. |
| public T | |
| public < the result type R> Observable | Returns: the new observablethe mapper function that returns an Observable for the scalar value of this func)Given this scalar source as input to a flatMap, avoid one step of subscription and subscribes to the single Observable returned by the function. |
| public Observable | Returns: the new observablethe target scheduler scheduler)Customized observeOn/subscribeOn implementation which emits the scalar value directly or with less overhead on the specified scheduler. |
| STRONG_MODE | back to summary |
|---|---|
| pack-priv static final boolean STRONG_MODE Indicates that the Producer used by this Observable should be fully thread-safe. It is possible, but unlikely that multiple concurrent requests will arrive to just(). | |
| t | back to summary |
|---|---|
| pack-priv final T t The constant scalar value to emit on request. | |
| ScalarSynchronousObservable | back to summary |
|---|---|
| protected ScalarSynchronousObservable(final T t) | |
| create | back to summary |
|---|---|
| public static <T> ScalarSynchronousObservable Constructs a ScalarSynchronousObservable with the given constant value.
| |
| createProducer | back to summary |
|---|---|
| pack-priv static <T> Producer createProducer(Subscriber<? super T> s, T v) Creates a scalar producer depending on the state of STRONG_MODE.
| |
| get | back to summary |
|---|---|
| public T get() Returns the scalar constant value directly.
| |
| scalarFlatMap | back to summary |
|---|---|
| public <R> Observable Given this scalar source as input to a flatMap, avoid one step of subscription and subscribes to the single Observable returned by the function. If the functions returns another scalar, no subscription happens and this inner scalar value will be emitted once requested.
| |
| scalarScheduleOn | back to summary |
|---|---|
| public Observable Customized observeOn/subscribeOn implementation which emits the scalar value directly or with less overhead on the specified scheduler.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final T |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| value | back to summary |
|---|---|
| pack-priv final T value | |
| JustOnSubscribe | back to summary |
|---|---|
| pack-priv JustOnSubscribe(T value) | |
| call | back to summary |
|---|---|
| public void call(Subscriber<? super T> s) Implements rx.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Func1 | |
| pack-priv final T |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| onSchedule | back to summary |
|---|---|
| pack-priv final Func1<Action0, Subscription> onSchedule | |
| value | back to summary |
|---|---|
| pack-priv final T value | |
| ScalarAsyncOnSubscribe | back to summary |
|---|---|
| pack-priv ScalarAsyncOnSubscribe(T value, Func1<Action0, Subscription> onSchedule) | |
| call | back to summary |
|---|---|
| public void call(Subscriber<? super T> s) Implements rx.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv final Func1 | |
| private static final long | |
| pack-priv final T |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| public String | toString()
Overrides java. |
| actual | back to summary |
|---|---|
| pack-priv final Subscriber<? super T> actual | |
| onSchedule | back to summary |
|---|---|
| pack-priv final Func1<Action0, Subscription> onSchedule | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| value | back to summary |
|---|---|
| pack-priv final T value | |
| ScalarAsyncProducer | back to summary |
|---|---|
| public ScalarAsyncProducer(Subscriber<? super T> actual, T value, Func1<Action0, Subscription> onSchedule) | |
| call | back to summary |
|---|---|
| public void call() Implements rx.
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns the String representation of the current value. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv boolean | |
| pack-priv final T |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| actual | back to summary |
|---|---|
| pack-priv final Subscriber<? super T> actual | |
| once | back to summary |
|---|---|
| pack-priv boolean once | |
| value | back to summary |
|---|---|
| pack-priv final T value | |
| WeakSingleProducer | back to summary |
|---|---|
| public WeakSingleProducer(Subscriber<? super T> actual, T value) | |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |