Skip to content

Commit

Permalink
Extend FluxConcatMap Refaster rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jun 10, 2024
1 parent d6838ec commit cda64c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ Flux<S> before(
@Matches(IsIdentityOperation.class)
Function<? super P, ? extends Publisher<? extends S>> identityOperation) {
return Refaster.anyOf(
flux.concatMap(function, 0),
flux.flatMap(function, 1),
flux.flatMapSequential(function, 1),
flux.map(function).concatMap(identityOperation));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ ImmutableSet<Flux<Integer>> testFluxSwitchIfEmptyOfEmptyPublisher() {

ImmutableSet<Flux<Integer>> testFluxConcatMap() {
return ImmutableSet.of(
Flux.just(1).flatMap(Mono::just, 1),
Flux.just(2).flatMapSequential(Mono::just, 1),
Flux.just(3).map(Mono::just).concatMap(identity()),
Flux.just(4).map(Mono::just).concatMap(v -> v),
Flux.just(5).map(Mono::just).concatMap(v -> Mono.empty()));
Flux.just(1).concatMap(Mono::just, 0),
Flux.just(2).flatMap(Mono::just, 1),
Flux.just(3).flatMapSequential(Mono::just, 1),
Flux.just(4).map(Mono::just).concatMap(identity()),
Flux.just(5).map(Mono::just).concatMap(v -> v),
Flux.just(6).map(Mono::just).concatMap(v -> Mono.empty()));
}

ImmutableSet<Flux<Integer>> testFluxConcatMapWithPrefetch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ ImmutableSet<Flux<Integer>> testFluxConcatMap() {
Flux.just(2).concatMap(Mono::just),
Flux.just(3).concatMap(Mono::just),
Flux.just(4).concatMap(Mono::just),
Flux.just(5).map(Mono::just).concatMap(v -> Mono.empty()));
Flux.just(5).concatMap(Mono::just),
Flux.just(6).map(Mono::just).concatMap(v -> Mono.empty()));
}

ImmutableSet<Flux<Integer>> testFluxConcatMapWithPrefetch() {
Expand Down

0 comments on commit cda64c1

Please sign in to comment.