Class OverflowStrategy

  • All Implemented Interfaces:
    java.io.Serializable

    public abstract class OverflowStrategy
    extends DelayOverflowStrategy
    Represents a strategy that decides how to deal with a buffer that is full but is about to receive a new element.
    See Also:
    Serialized Form
    • Constructor Detail

      • OverflowStrategy

        public OverflowStrategy()
    • Method Detail

      • dropHead

        public static OverflowStrategy dropHead()
        If the buffer is full when a new element arrives, drops the oldest element from the buffer to make space for the new element.
      • dropTail

        public static OverflowStrategy dropTail()
        If the buffer is full when a new element arrives, drops the youngest element from the buffer to make space for the new element.
      • dropBuffer

        public static OverflowStrategy dropBuffer()
        If the buffer is full when a new element arrives, drops all the buffered elements to make space for the new element.
      • dropNew

        public static OverflowStrategy dropNew()
        Deprecated.
        Use pekko.stream.javadsl.Source#queue(int,org.apache.pekko.stream.OverflowStrategy) instead
        If the buffer is full when a new element arrives, drops the new element.

      • backpressure

        public static OverflowStrategy backpressure()
        If the buffer is full when a new element is available this strategy backpressures the upstream publisher until space becomes available in the buffer.
      • fail

        public static OverflowStrategy fail()
        If the buffer is full when a new element is available this strategy completes the stream with failure.