Package io.micrometer.statsd.internal
Class BufferingFlux
java.lang.Object
io.micrometer.statsd.internal.BufferingFlux
-
Method Summary
Modifier and TypeMethodDescriptionstatic reactor.core.publisher.Flux<String>
create
(reactor.core.publisher.Flux<String> source, 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 Details
-
create
public static reactor.core.publisher.Flux<String> create(reactor.core.publisher.Flux<String> source, 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:
-