| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | FlowableCache.CacheSubscription<
the value type T>Hosts the downstream consumer and its current requested and replay states. |
| pack-priv static class | FlowableCache.Node<
the element type T>Represents a segment of the cached item list as part of a linked-node-list structure. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | capacityHint
The number of items per cached nodes. |
| pack-priv volatile boolean | done
True if the source has terminated. |
| pack-priv static final FlowableCache. | EMPTY
A shared instance of an empty array of subscribers to avoid creating a new empty array when all subscribers cancel. |
| pack-priv Throwable | error
If |
| pack-priv final FlowableCache. | head
The starting point of the cached items. |
| pack-priv final AtomicBoolean | once
The subscription to the source should happen at most once. |
| pack-priv volatile long | size
The total number of elements in the list available for reads. |
| pack-priv final AtomicReference | subscribers
The current known array of subscriber state to notify. |
| pack-priv FlowableCache. | tail
The current tail of the linked structure holding the items. |
| pack-priv int | tailOffset
How many items have been put into the tail node so far. |
| pack-priv static final FlowableCache. | TERMINATED
A shared instance indicating the source has no more events and there is no need to remember subscribers anymore. |
| Access | Constructor and Description |
|---|---|
| public | FlowableCache(Flowable<T>
the source to subscribe to for the first incoming subscriber source, int the number of items expected (reduce allocation frequency) capacityHint)Constructs an empty, non-connected cache. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | add(FlowableCache.
the consumer to add consumerAtomically adds the consumer to the |
| pack-priv long | Returns: the number of currently cached event countReturns the number of events currently cached. |
| pack-priv boolean | Returns: true if the cache has SubscribersReturns true if there are observers subscribed to this observable. |
| pack-priv boolean | Returns: true if already connectedCheck if this cached observable is connected to its source. |
| public void | |
| public void | onError(Throwable
the throwable signaled t)Implements org. |
| public void | onNext(T
the element signaled t)Implements org. Publisher in response to requests to Subscription#request(long).
|
| public void | onSubscribe(Subscription
the s)Subscription that allows requesting data via Subscription#request(long)Implements io. onNext(Object) is established before
calling Subscription#request(long).
|
| pack-priv void | remove(FlowableCache.
the consumer to remove consumerAtomically removes the consumer from the |
| pack-priv void | replay(FlowableCache.
the consumer to continue replaying items to consumerReplays the contents of this cache to the given consumer based on its current state and number of items requested by it. |
| protected void | subscribeActual(Subscriber<? super T>
the incoming Subscriber, never null t)Implements abstract io. Subscribers.
|
| capacityHint | back to summary |
|---|---|
| pack-priv final int capacityHint The number of items per cached nodes. | |
| done | back to summary |
|---|---|
| pack-priv volatile boolean done True if the source has terminated. | |
| EMPTY | back to summary |
|---|---|
| pack-priv static final FlowableCache. A shared instance of an empty array of subscribers to avoid creating a new empty array when all subscribers cancel.
| |
| error | back to summary |
|---|---|
| pack-priv Throwable error If | |
| head | back to summary |
|---|---|
| pack-priv final FlowableCache. The starting point of the cached items. | |
| once | back to summary |
|---|---|
| pack-priv final AtomicBoolean once The subscription to the source should happen at most once. | |
| size | back to summary |
|---|---|
| pack-priv volatile long size The total number of elements in the list available for reads. | |
| subscribers | back to summary |
|---|---|
| pack-priv final AtomicReference<FlowableCache. The current known array of subscriber state to notify. | |
| tail | back to summary |
|---|---|
| pack-priv FlowableCache. The current tail of the linked structure holding the items. | |
| tailOffset | back to summary |
|---|---|
| pack-priv int tailOffset How many items have been put into the tail node so far. | |
| TERMINATED | back to summary |
|---|---|
| pack-priv static final FlowableCache. A shared instance indicating the source has no more events and there is no need to remember subscribers anymore.
| |
| FlowableCache | back to summary |
|---|---|
| public FlowableCache(Flowable<T> source, int capacityHint) Constructs an empty, non-connected cache.
| |
| add | back to summary |
|---|---|
| pack-priv void add(FlowableCache. Atomically adds the consumer to the
| |
| cachedEventCount | back to summary |
|---|---|
| pack-priv long cachedEventCount() Returns the number of events currently cached.
| |
| hasSubscribers | back to summary |
|---|---|
| pack-priv boolean hasSubscribers() Returns true if there are observers subscribed to this observable.
| |
| isConnected | back to summary |
|---|---|
| pack-priv boolean isConnected() Check if this cached observable is connected to its source.
| |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements org. Doc from org. Successful terminal state.
No further events will be sent even if
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable t) Implements org. Doc from org. Failed terminal state.
No further events will be sent even if
| |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements org. Doc from org. Data notification sent by the
| |
| onSubscribe | back to summary |
|---|---|
| public void onSubscribe(Subscription s) Implements io. Doc from io. Implementors of this method should make sure everything that needs
to be visible in
No data will start flowing until
It is the responsibility of this
The
| |
| remove | back to summary |
|---|---|
| pack-priv void remove(FlowableCache. Atomically removes the consumer from the
| |
| replay | back to summary |
|---|---|
| pack-priv void replay(FlowableCache. Replays the contents of this cache to the given consumer based on its current state and number of items requested by it.
| |
| subscribeActual | back to summary |
|---|---|
| protected void subscribeActual(Subscriber<? super T> t) Implements abstract io. Doc from io. Operator implementations (both source and intermediate) should implement this method that
performs the necessary business logic and handles the incoming There is no need to call any of the plugin hooks on the current
| |
this holds the work-in-progress counter for the serialized replay.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | |
| pack-priv long | |
| pack-priv FlowableCache. | |
| pack-priv int | |
| pack-priv final FlowableCache | |
| pack-priv final AtomicLong | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | CacheSubscription(Subscriber<? super T>
the actual consumer downstream, FlowableCache<T> the parent that holds onto the cached items parent)Constructs a new instance with the actual downstream consumer and the parent cache object. |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancel()
Implements org. Publisher to stop sending data and clean up resources.
|
| public void | request(long
the strictly positive number of elements to requests to the upstream n)PublisherImplements org. Publisher until demand is signaled via this method.
|
| downstream | back to summary |
|---|---|
| pack-priv final Subscriber<? super T> downstream | |
| index | back to summary |
|---|---|
| pack-priv long index | |
| node | back to summary |
|---|---|
| pack-priv FlowableCache. | |
| offset | back to summary |
|---|---|
| pack-priv int offset | |
| parent | back to summary |
|---|---|
| pack-priv final FlowableCache<T> parent | |
| requested | back to summary |
|---|---|
| pack-priv final AtomicLong requested | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| CacheSubscription | back to summary |
|---|---|
| pack-priv CacheSubscription(Subscriber<? super T> downstream, FlowableCache<T> parent) Constructs a new instance with the actual downstream consumer and the parent cache object.
| |
| cancel | back to summary |
|---|---|
| public void cancel() Implements org. Doc from org. Request the Data may still be sent to meet previously signalled demand after calling cancel.
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements org. Doc from org. No events will be sent by a
It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more,
it may be treated by the
Whatever has been requested can be sent by the
A | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile FlowableCache. | next
The next node if not null. |
| pack-priv final T[] | values
The array of values held by this node. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| next | back to summary |
|---|---|
| pack-priv volatile FlowableCache. The next node if not null. | |
| values | back to summary |
|---|---|
| pack-priv final T[] values The array of values held by this node. | |
| Node | back to summary |
|---|---|
pack-priv Node(int capacityHint)
| |