Package reactor.core
Interface Fuseable.QueueSubscription<T>
- Type Parameters:
T- the value type emitted
- All Superinterfaces:
Collection<T>,Iterable<T>,Queue<T>,Subscription
- All Known Subinterfaces:
Fuseable.SynchronousSubscription<T>
- All Known Implementing Classes:
Operators.MonoSubscriber,UnicastProcessor
- Enclosing interface:
- Fuseable
Support contract for queue-fusion based optimizations on subscriptions.
- Synchronous sources which have fixed size and can emit their items in a pull fashion, thus avoiding the request-accounting overhead in many cases.
- Asynchronous sources which can act as a queue and subscription at the same time, saving on allocating another queue most of the time.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault booleanaddAll(Collection<? extends T> c) default booleandefault booleancontainsAll(Collection<?> c) default Telement()iterator()default booleanpeek()default Tremove()default booleandefault booleanremoveAll(Collection<?> c) intrequestFusion(int requestedMode) Request a specific fusion mode from this QueueSubscription.default booleanretainAll(Collection<?> c) default Object[]toArray()default <T1> T1[]toArray(T1[] a) Methods inherited from interface java.util.Collection
clear, equals, hashCode, isEmpty, parallelStream, removeIf, size, spliterator, stream, toArrayMethods inherited from interface org.reactivestreams.Subscription
cancel, request
-
Field Details
-
NOT_SUPPORTED_MESSAGE
- See Also:
-
-
Method Details
-
requestFusion
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.
- Parameters:
requestedMode- the mode requested by the intermediate operator- Returns:
- the actual fusion mode activated
-
peek
-
add
-
offer
-
remove
-
element
-
contains
- Specified by:
containsin interfaceCollection<T>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
default <T1> T1[] toArray(T1[] a) - Specified by:
toArrayin interfaceCollection<T>
-
remove
- Specified by:
removein interfaceCollection<T>
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>
-
addAll
- Specified by:
addAllin interfaceCollection<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>
-