QueueSubscription.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Fuseable.ConditionalSubscriber<
the value type T>A subscriber variant that can immediately tell if it consumed the value or not, directly allowing a new value to be sent if it didn't. |
| public static interface | Fuseable.QueueSubscription<
the value type emitted T>Support contract for queue-fusion based optimizations on subscriptions. |
| public static interface | Fuseable.ScalarCallable<
the value type returned T>Marker interface indicating that the target can return a value or null, otherwise fail immediately and thus a viable target for assembly-time optimizations. |
| public static interface | Fuseable.SynchronousSubscription<
the content value type T>Base class for synchronous sources which have fixed size and can emit their items in a pull fashion, thus avoiding the request-accounting overhead in many cases. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ANY
Indicates the QueueSubscription should decide what fusion it performs (input only). |
| public static final int | ASYNC
Indicates the QueueSubscription can perform only async-fusion. |
| public static final int | NONE
Indicates the QueueSubscription can't support the requested mode. |
| public static final int | SYNC
Indicates the QueueSubscription can perform sync-fusion. |
| public static final int | THREAD_BARRIER
Indicates that the queue will be drained from another thread thus any queue-exit computation may be invalid at that point. |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: a human-readableString representation of the codethe fusion mode int code mode)Attempt to convert a fusion mode int code into a human-readable representation. |
| public static String | Returns: a human-readableString representation of the codethe fusion mode int code mode, boolean whether or not to ignore the ignoreThreadBarrier)THREAD_BARRIER flag in the representationAttempt to convert a fusion mode int code into a human-readable representation. |
| ANY | back to summary |
|---|---|
| public static final int ANY Indicates the QueueSubscription should decide what fusion it performs (input only). | |
| ASYNC | back to summary |
|---|---|
| public static final int ASYNC Indicates the QueueSubscription can perform only async-fusion. | |
| NONE | back to summary |
|---|---|
| public static final int NONE Indicates the QueueSubscription can't support the requested mode. | |
| SYNC | back to summary |
|---|---|
| public static final int SYNC Indicates the QueueSubscription can perform sync-fusion. | |
| THREAD_BARRIER | back to summary |
|---|---|
| public static final int THREAD_BARRIER Indicates that the queue will be drained from another thread thus any queue-exit computation may be invalid at that point.
For example, an | |
| fusionModeName | back to summary |
|---|---|
| public static String fusionModeName(int mode) Attempt to convert a fusion mode int code into a human-readable representation.
Note that this can include the
This method accepts Note that as this is a human-facing representation, the different values could evolve in the future. As such, never compare the returned string to a constant, but always use this method on both sides of a comparison. | |
| fusionModeName | back to summary |
|---|---|
| public static String fusionModeName(int mode, boolean ignoreThreadBarrier) Attempt to convert a fusion mode int code into a human-readable representation.
Note that this can include the
This method accepts Note that as this is a human-facing representation, the different values could evolve in the future. As such, never compare the returned string to a constant, but always use this method on both sides of a comparison.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if consumed, false if dropped and a new value can be immediately sentthe value to consume, not null t)Try consuming the value and return true if successful. |
| tryOnNext | back to summary |
|---|---|
| public boolean tryOnNext(T t) Try consuming the value and return true if successful.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final String |
| Modifier and Type | Method and Description |
|---|---|
| public default boolean | add(T
the element to add t)Implements java. true upon success and throwing an IllegalStateException
if no space is currently available.
|
| public default boolean | addAll(Collection<? extends T>
collection containing elements to be added to this collection c)Implements java. |
| public default boolean | contains(Object
element whose presence in this collection is to be tested o)Implements java. true if this collection contains the specified element.
|
| public default boolean | containsAll(Collection<?>
collection to be checked for containment in this collection c)Implements java. true if this collection contains all of the elements
in the specified collection.
|
| public default T | element()
Implements java. |
| public default Iterator | iterator()
Implements java. |
| public default boolean | offer(T
the element to add t)Implements java. |
| public default T | peek()
Implements java. null if this queue is empty.
|
| public default T | |
| public default boolean | remove(Object
element to be removed from this collection, if present o)Implements java. |
| public default boolean | removeAll(Collection<?>
collection containing elements to be removed from this collection c)Implements java. |
| public int | Returns: the actual fusion mode activatedthe mode requested by the intermediate operator requestedMode)Request a specific fusion mode from this QueueSubscription. |
| public default boolean | retainAll(Collection<?>
collection containing elements to be retained in this collection c)Implements java. |
| public default Object[] | toArray()
Implements java. |
| public default <T1> T1[] | toArray(T1[]
the array into which the elements of this collection are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose. a)Implements java. |
| NOT_SUPPORTED_MESSAGE | back to summary |
|---|---|
| public static final String NOT_SUPPORTED_MESSAGE | |
| add | back to summary |
|---|---|
| public default boolean add(T t) Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
| |
| addAll | back to summary |
|---|---|
| public default boolean addAll(Collection<? extends T> c) Implements java. Doc from java. Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) If the specified collection has a defined encounter order, processing of its elements generally occurs in that order.
| |
| contains | back to summary |
|---|---|
| public default boolean contains(Object o) Implements java. Doc from java. Returns | |
| containsAll | back to summary |
|---|---|
| public default boolean containsAll(Collection<?> c) Implements java. Doc from java. Returns
| |
| element | back to summary |
|---|---|
| public default T element() Implements java. Doc from java. Retrieves, but does not remove, the head of this queue. This method
differs from
| |
| iterator | back to summary |
|---|---|
| public default Iterator Implements java. Doc from java. Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee). | |
| offer | back to summary |
|---|---|
| public default boolean offer(T t) Implements java. Doc from java. Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
When using a capacity-restricted queue, this method is generally
preferable to
| |
| peek | back to summary |
|---|---|
| public default T peek() Implements java. Doc from java. Retrieves, but does not remove, the head of this queue,
or returns | |
| remove | back to summary |
|---|---|
| public default T remove() Implements java. Doc from java. Retrieves and removes the head of this queue. This method differs
from
| |
| remove | back to summary |
|---|---|
| public default boolean remove(Object o) Implements java. Doc from java. Removes a single instance of the specified element from this
collection, if it is present (optional operation). More formally,
removes an element | |
| removeAll | back to summary |
|---|---|
| public default boolean removeAll(Collection<?> c) Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
| |
| requestFusion | back to summary |
|---|---|
| public int requestFusion(int requestedMode) Request a specific fusion mode from this QueueSubscription. One should request either SYNC, ASYNC or ANY modes (never NONE) and the implementor should return NONE, SYNC or ASYNC (never ANY). For example, if a source supports only ASYNC fusion but the intermediate operator supports only SYNC fuseable sources, the operator may request SYNC fusion and the source can reject it via NONE, thus the operator can return NONE as well to downstream and the fusion doesn't happen.
| |
| retainAll | back to summary |
|---|---|
| public default boolean retainAll(Collection<?> c) Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
| |
| toArray | back to summary |
|---|---|
| public default Object[] toArray() Implements java. Doc from java. Returns an array containing all of the elements in this collection.
If this collection makes any guarantees as to what order its elements
are returned by its iterator, this method must return the elements in
the same order. The returned array's runtime component type is The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
| |
| toArray | back to summary |
|---|---|
| public default <T1> T1[] toArray(T1[] a) Implements java. Doc from java. Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection. If this collection fits in the specified array with room to spare
(i.e., the array has more elements than this collection), the element
in the array immediately following the end of the collection is set to
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
| |
| Modifier and Type | Method and Description |
|---|---|
| public default int | requestFusion(int
the mode requested by the intermediate operator requestedMode)Implements reactor. |
| requestFusion | back to summary |
|---|---|
| public default int requestFusion(int requestedMode) Implements reactor. Doc from reactor. Request a specific fusion mode from this QueueSubscription. One should request either SYNC, ASYNC or ANY modes (never NONE) and the implementor should return NONE, SYNC or ASYNC (never ANY). For example, if a source supports only ASYNC fusion but the intermediate operator supports only SYNC fuseable sources, the operator may request SYNC fusion and the source can reject it via NONE, thus the operator can return NONE as well to downstream and the fusion doesn't happen.
| |