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

Prefer the lazy version of Mono#fromFuture #1244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Venorcis
Copy link
Contributor

Futures subscribe eagerly. This means that Mono#fromFuture(CompletableFuture) already executes the contents of the future on assembly time (even when that Future is constructed from a Mono as we do in our reactive Caffeine caches).

I therefore suggest instead to always use Mono#fromFuture(Supplier), which will only instantiate (and thus execute) the future on subscription, i.e. much closer to how we usually do everything 😄

@Venorcis Venorcis requested a review from Stephan202 July 12, 2024 15:02
Copy link

Looks good. No mutations were possible for these changes.
Mutation testing report by Pitest. Review any surviving mutants by inspecting the line comments under Files changed.

Copy link

sonarcloud bot commented Jul 12, 2024

@Venorcis Venorcis changed the title Prefer the lazy version of Mono#fromFuture Prefer the lazy version of Mono#fromFuture Jul 15, 2024
@rickie rickie self-requested a review July 17, 2024 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant