From 9e581ab8f1dacc073fd57777e59f824ad0502d31 Mon Sep 17 00:00:00 2001 From: spierce Date: Mon, 24 Jun 2024 12:50:20 -0500 Subject: [PATCH] [#3821] Add note about Collection::add to `bufferTimeout` operators that take a `bufferSupplier` --- .../main/java/reactor/core/publisher/Flux.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactor-core/src/main/java/reactor/core/publisher/Flux.java b/reactor-core/src/main/java/reactor/core/publisher/Flux.java index d28f3fccce..9047883e67 100644 --- a/reactor-core/src/main/java/reactor/core/publisher/Flux.java +++ b/reactor-core/src/main/java/reactor/core/publisher/Flux.java @@ -3123,6 +3123,10 @@ public final Flux> bufferTimeout(int maxSize, Duration maxTime) { * will be emitted by the returned {@link Flux} each time the buffer reaches a maximum * size OR the maxTime {@link Duration} elapses. *

+ * Note that if buffers provided by bufferSupplier may return {@literal false} upon invocation + * of {@link Collection#add(Object)}, buffer emission may be triggered when the buffer size is + * less than the specified max size. + *

* * *

Discard Support: This operator discards the currently open buffer upon cancellation or error triggered by a data signal. @@ -3163,6 +3167,10 @@ public final Flux> bufferTimeout(int maxSize, Duration maxTime, Schedule * will be emitted by the returned {@link Flux} each time the buffer reaches a maximum * size OR the maxTime {@link Duration} elapses, as measured on the provided {@link Scheduler}. *

+ * Note that if buffers provided by bufferSupplier may return {@literal false} upon invocation + * of {@link Collection#add(Object)}, buffer emission may be triggered when the buffer size is + * less than the specified max size. + *

* * *

Discard Support: This operator discards the currently open buffer upon cancellation or error triggered by a data signal. @@ -3230,6 +3238,10 @@ public final Flux> bufferTimeout(int maxSize, Duration maxTime, * will be emitted by the returned {@link Flux} each time the buffer reaches a maximum * size OR the maxTime {@link Duration} elapses. *

+ * Note that if buffers provided by bufferSupplier may return {@literal false} upon invocation + * of {@link Collection#add(Object)}, buffer emission may be triggered when the buffer size is + * less than the specified max size. + *

* * *

Discard Support: This operator discards the currently open buffer upon cancellation or error triggered by a data signal. @@ -3254,6 +3266,10 @@ public final > Flux bufferTimeout(int maxSiz * will be emitted by the returned {@link Flux} each time the buffer reaches a maximum * size OR the maxTime {@link Duration} elapses, as measured on the provided {@link Scheduler}. *

+ * Note that if buffers provided by bufferSupplier may return {@literal false} upon invocation + * of {@link Collection#add(Object)}, buffer emission may be triggered when the buffer size is + * less than the specified max size. + *

* * *

Discard Support: This operator discards the currently open buffer upon cancellation or error triggered by a data signal.