Class MultiOverflow<T>


  • public class MultiOverflow<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiOverflow​(Multi<T> upstream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Multi<T> buffer()
      When the downstream cannot keep up with the upstream emissions, instruct to use an unbounded buffer to store the items until they are consumed.
      Multi<T> buffer​(int size)
      When the downstream cannot keep up with the upstream emissions, instruct to use a buffer of size size to store the items until they are consumed.
      MultiOverflowStrategy<T> call​(java.util.function.Function<T,​Uni<?>> mapper)
      Define an overflow dropped item mapper to a Uni.
      MultiOverflowStrategy<T> call​(java.util.function.Supplier<Uni<?>> supplier)
      Define an overflow callback to a Uni.
      Multi<T> drop()
      When the downstream cannot keep up with the upstream emissions, instruct to drop the item.
      Multi<T> dropPreviousItems()
      When the downstream cannot keep up with the upstream emissions, instruct to drop all previously buffered items.
      MultiOverflowStrategy<T> invoke​(java.lang.Runnable callback)
      Define an overflow callback.
      MultiOverflowStrategy<T> invoke​(java.util.function.Consumer<T> consumer)
      Define an overflow callback.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiOverflow

        public MultiOverflow​(Multi<T> upstream)
    • Method Detail

      • buffer

        @CheckReturnValue
        public Multi<T> buffer()
        When the downstream cannot keep up with the upstream emissions, instruct to use an unbounded buffer to store the items until they are consumed.
        Returns:
        the new multi
      • buffer

        @CheckReturnValue
        public Multi<T> buffer​(int size)
        When the downstream cannot keep up with the upstream emissions, instruct to use a buffer of size size to store the items until they are consumed. When the buffer is full, a BackPressureFailure is propagated downstream and the upstream source is cancelled.
        Parameters:
        size - the size of the buffer, must be strictly positive
        Returns:
        the new multi
      • drop

        @CheckReturnValue
        public Multi<T> drop()
        When the downstream cannot keep up with the upstream emissions, instruct to drop the item.
        Returns:
        the new multi
      • dropPreviousItems

        @CheckReturnValue
        public Multi<T> dropPreviousItems()
        When the downstream cannot keep up with the upstream emissions, instruct to drop all previously buffered items.
        Returns:
        the new multi
      • invoke

        @CheckReturnValue
        public MultiOverflowStrategy<T> invoke​(java.util.function.Consumer<T> consumer)
        Define an overflow callback.
        Parameters:
        consumer - the dropped item consumer, must not be null, must not return null
        Returns:
        an object to select the overflow management strategy
      • invoke

        @CheckReturnValue
        public MultiOverflowStrategy<T> invoke​(java.lang.Runnable callback)
        Define an overflow callback.
        Parameters:
        callback - a callback when overflow happens, must not be null, must not return null
        Returns:
        an object to select the overflow management strategy
      • call

        @CheckReturnValue
        public MultiOverflowStrategy<T> call​(java.util.function.Supplier<Uni<?>> supplier)
        Define an overflow callback to a Uni.
        Parameters:
        supplier - a supplier of a Uni, must not be null, must not return null
        Returns:
        an object to select the overflow management strategy
      • call

        @CheckReturnValue
        public MultiOverflowStrategy<T> call​(java.util.function.Function<T,​Uni<?>> mapper)
        Define an overflow dropped item mapper to a Uni.
        Parameters:
        mapper - a mapper of a dropped item to a Uni, must not be null, must not return null
        Returns:
        an object to select the overflow management strategy