Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend MonoFlux Refaster rule #358

Merged
merged 3 commits into from
Nov 19, 2022
Merged

Extend MonoFlux Refaster rule #358

merged 3 commits into from
Nov 19, 2022

Conversation

werli
Copy link
Member

@werli werli commented Nov 18, 2022

As I had noticed during code review. 👍

Suggested commit message

Extend `MonoFlux` Refaster rule (#358)

@rickie rickie requested review from rickie and Stephan202 and removed request for rickie November 18, 2022 14:56
Copy link
Member

@rickie rickie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased and added a commit.

Nice addition @werli 🚀!
Tried to think of other possible variants but couldn't think of them.

Alternative suggested commit message (or we should just use the already proposed one 🤔):

Have `MonoFlux` flag `Mono#FlatMapMany(Flux::just)` cases

@@ -559,7 +559,7 @@ Flux<S> after(Flux<T> flux) {
static final class MonoFlux<T> {
@BeforeTemplate
Flux<T> before(Mono<T> mono) {
return Flux.concat(mono);
return Refaster.anyOf(Flux.concat(mono), mono.flatMapMany(Flux::just));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually list Monos before Fluxes, so will change the order :).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted for the future. 📝

@rickie rickie added this to the 0.6.0 milestone Nov 19, 2022
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a commit.

Suggested commit message, in light of further additions:

Extend `MonoFlux` Refaster rule (#358)

@@ -559,7 +559,7 @@ Flux<S> after(Flux<T> flux) {
static final class MonoFlux<T> {
@BeforeTemplate
Flux<T> before(Mono<T> mono) {
return Flux.concat(mono);
return Refaster.anyOf(mono.flatMapMany(Flux::just), Flux.concat(mono));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also Mono::just 🙃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one. 👍 Thanks!

@rickie rickie merged commit 79b0123 into master Nov 19, 2022
@rickie rickie deleted the werli/mono-flux-just branch November 19, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants