-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support creation of empty mono from lambda that returns a nullable value #743
Comments
@sdeleuze @rstoyanchev WDYT |
Didn't we discuss at some point supporting that (nullable lambda arguments with |
Precision: my question/proposal is about the possibility to support " Notice also that I am about to send a PR with null-safety of generic type arguments so this kind of behavior will be declared explicitly at API level in any case, avoiding confusion. |
This has the side-effect that Mono#fromRunnable should always be requested when using `subscribeOn`.
Background on why this has been discussed and deferred before: the |
This has the side-effect that Mono#fromRunnable should always be requested when using `subscribeOn`.
This has the side-effect that Mono#fromRunnable should always be requested when using `subscribeOn`.
@simonbasle I had a look at the current implementation and I think it would be great if we could tweak it a little bit. Lets assume that we have a kotlin lambda that returns a nullable value of type:
Using the current implementation I would get a This may not be what we want as a
to
This way we would get a
|
@simonbasle should I open a new issue to discuss this proposal? |
@sbuettner no I don't think this warrants another issue. would love to get a PR to better evaluate this follow-up, if that is not too much trouble (reference this issue in the PR description) |
@simonbasle Ok, I will try to come up with something 😄 |
Imagine you are in kotlin land and want to return a
Mono<X>
from an existing functionfun x(): X?
. Currently its only possible to wrap each call tox()
using the Mono.create like:It would be nice to have some kind of generic shorthand method like this to allow a simple creation of a lazy mono like:
where you would simply write:
fromCallableOrEmpty { x() }
.The text was updated successfully, but these errors were encountered: