Class BufferingFlux


  • public class BufferingFlux
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static reactor.core.publisher.Flux<java.lang.String> create​(reactor.core.publisher.Flux<java.lang.String> source, java.lang.String delimiter, int maxByteArraySize, long maxMillisecondsBetweenEmits)
      Creates a Flux that implements Nagle's algorithm to buffer messages -- joined by a delimiter string -- to up a maximum number of bytes, or a maximum duration of time.
      • Methods inherited from class java.lang.Object

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

      • create

        public static reactor.core.publisher.Flux<java.lang.String> create​(reactor.core.publisher.Flux<java.lang.String> source,
                                                                           java.lang.String delimiter,
                                                                           int maxByteArraySize,
                                                                           long maxMillisecondsBetweenEmits)
        Creates a Flux that implements Nagle's algorithm to buffer messages -- joined by a delimiter string -- to up a maximum number of bytes, or a maximum duration of time. This avoids sending many small packets in favor of fewer larger ones.
        Parameters:
        source - The input flux.
        delimiter - The delimiter to use to join messages
        maxByteArraySize - The buffered payload will contain no more than this number of bytes
        maxMillisecondsBetweenEmits - Buffered payloads will be emitted no less frequently than this.
        Returns:
        A flux implementing Nagle's algorithm.
        See Also:
        Nagle's algorithm