reactor-core/src/main/java/reactor/core/publisher/Flux.java
public final <K> Flux<GroupedFlux<K, T>> groupBy(Function<? super T, ? extends K> keyMapper) {
		return groupBy(keyMapper, identityFunction());
	}
public final <K> Flux<GroupedFlux<K, T>> groupBy(Function<? super T, ? extends K> keyMapper) {
		return groupBy(keyMapper, identityFunction());
	}
public final < K > Flux < GroupedFlux < K , T > > groupBy ( Function < ? super T , ? extends K > keyMapper ) { return groupBy ( keyMapper , identityFunction ( ) ) ; }
Divide this sequence into dynamically created {@link Flux} (or groups) for each
unique key, as produced by the provided keyMapper {@link Function}. Note that
groupBy works best with a low cardinality of groups, so chose your keyMapper
function accordingly.

<p>
<img class="marble" src="doc-files/marbles/groupByWithKeyMapper.svg" alt="">

<p>
The groups need to be drained and consumed downstream for groupBy to work correctly.
Notably when the criteria produces a large amount of groups, it can lead to hanging
if the groups are not suitably consumed downstream (eg. due to a {@code flatMap}
with a {@code maxConcurrency} parameter that is set too low).

@param keyMapper the key mapping {@link Function} that evaluates an incoming data and returns a key.
@param <K> the key type extracted from each value of this sequence

@return a {@link Flux} of {@link GroupedFlux} grouped sequences
Divide this sequence into dynamically created { @link Flux } ( or groups ) for each unique key as produced by the provided keyMapper { @link Function } . Note that groupBy works best with a low cardinality of groups so chose your keyMapper function accordingly .