Package io.micrometer.statsd.internal
Class BufferingFlux
- java.lang.Object
-
- io.micrometer.statsd.internal.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.
-
-
-
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 messagesmaxByteArraySize
- The buffered payload will contain no more than this number of bytesmaxMillisecondsBetweenEmits
- Buffered payloads will be emitted no less frequently than this.- Returns:
- A flux implementing Nagle's algorithm.
- See Also:
- Nagle's algorithm
-
-