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

public static interface Fuseable.QueueSubscription<T> extends Queue<T>, Subscription
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 Details

  • 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

      default @Nullable T peek()
      Specified by:
      peek in interface Queue<T>
    • add

      default boolean add(@Nullable T t)
      Specified by:
      add in interface Collection<T>
      Specified by:
      add in interface Queue<T>
    • offer

      default boolean offer(@Nullable T t)
      Specified by:
      offer in interface Queue<T>
    • remove

      default T remove()
      Specified by:
      remove in interface Queue<T>
    • element

      default T element()
      Specified by:
      element in interface Queue<T>
    • contains

      default boolean contains(@Nullable Object o)
      Specified by:
      contains in interface Collection<T>
    • iterator

      default Iterator<T> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
    • toArray

      default Object[] toArray()
      Specified by:
      toArray in interface Collection<T>
    • toArray

      default <T1> T1[] toArray(T1[] a)
      Specified by:
      toArray in interface Collection<T>
    • remove

      default boolean remove(@Nullable Object o)
      Specified by:
      remove in interface Collection<T>
    • containsAll

      default boolean containsAll(Collection<?> c)
      Specified by:
      containsAll in interface Collection<T>
    • addAll

      default boolean addAll(Collection<? extends T> c)
      Specified by:
      addAll in interface Collection<T>
    • removeAll

      default boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<T>
    • retainAll

      default boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<T>