Class MultiOverflowStrategy<T>


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

      Constructors 
      Constructor Description
      MultiOverflowStrategy​(Multi<T> upstream, java.util.function.Consumer<T> dropConsumer, java.util.function.Function<T,​Uni<?>> dropUniMapper)  
    • 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 a bounded buffer of the default size 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.
      Multi<T> bufferUnconditionally()
      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> 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.
      • Methods inherited from class java.lang.Object

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

      • MultiOverflowStrategy

        public MultiOverflowStrategy​(Multi<T> upstream,
                                     java.util.function.Consumer<T> dropConsumer,
                                     java.util.function.Function<T,​Uni<?>> dropUniMapper)
    • Method Detail

      • 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
      • buffer

        @CheckReturnValue
        public Multi<T> buffer()
        When the downstream cannot keep up with the upstream emissions, instruct to use a bounded buffer of the default size to store the items until they are consumed.
        Returns:
        the new multi
        See Also:
        Infrastructure.setMultiOverflowDefaultBufferSize(int)
      • 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
      • bufferUnconditionally

        @CheckReturnValue
        public Multi<T> bufferUnconditionally()
        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
      • 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