reactor-core/src/main/java/reactor/core/publisher/Flux.java
public final <U, V, C extends Collection<? super T>> Flux<C> bufferWhen(Publisher<U> bucketOpening,
			Function<? super U, ? extends Publisher<V>> closeSelector, Supplier<C> bufferSupplier) {
		return onAssembly(new FluxBufferWhen<>(this, bucketOpening, closeSelector,
				bufferSupplier, Queues.unbounded(Queues.XS_BUFFER_SIZE)));
	}
public final <U, V, C extends Collection<? super T>> Flux<C> bufferWhen(Publisher<U> bucketOpening,
			Function<? super U, ? extends Publisher<V>> closeSelector, Supplier<C> bufferSupplier) {
		return onAssembly(new FluxBufferWhen<>(this, bucketOpening, closeSelector,
				bufferSupplier, Queues.unbounded(Queues.XS_BUFFER_SIZE)));
	}
Collect incoming values into multiple user-defined {@link Collection} buffers started each time an opening
companion {@link Publisher} emits. Each buffer will last until the corresponding
closing companion {@link Publisher} emits, thus releasing the buffer to the resulting {@link Flux}.
<p>
When Open signal is strictly not overlapping Close signal : dropping buffers (see green marbles in diagram below).
<p>
When Open signal is strictly more frequent than Close signal : overlapping buffers (see second and third buffers in diagram below).
<p>
<img class="marble" src="doc-files/marbles/bufferWhenWithSupplier.svg" alt="">

@reactor.discard This operator discards the currently open buffer upon cancellation or error triggered by a data signal.
It DOES NOT provide strong guarantees in the case of overlapping buffers, as elements
might get discarded too early (from the first of two overlapping buffers for instance).

@param bucketOpening a companion {@link Publisher} to subscribe for buffer creation signals.
@param closeSelector a factory that, given a buffer opening signal, returns a companion
{@link Publisher} to subscribe to for buffer closure and emission signals.
@param bufferSupplier a {@link Supplier} of the concrete {@link Collection} to use for each buffer
@param <U> the element type of the buffer-opening sequence
@param <V> the element type of the buffer-closing sequence
@param <C> the {@link Collection} buffer type

@return a microbatched {@link Flux} of {@link Collection} delimited by an opening {@link Publisher} and a relative
closing {@link Publisher}