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
Fix RSocketRequester API for requests without payload #23649
Comments
I think this change aligns nicely with our infrastructure and RSocket in general, because:
The alternative would be to have a |
This commit makes it possible to send requests without without requiring to call data(Mono.empty). It clarifies the semantics by renaming ResponseSpec to InteractionSpec in order to leverage more directly RSocket vocabulary and make things more consistent now that RequestSpec extends it. It also improves the Consumer variant of metadata in order to prevent calling data in the callback (only metadata is now accessible). Closes spring-projectsgh-23649
This commit makes it possible to send requests without without requiring to call data(Mono.empty). It clarifies the semantics by renaming ResponseSpec to InteractionSpec in order to leverage more directly RSocket vocabulary and make things more consistent now that RequestSpec extends it. It also improves the Consumer variant of metadata in order to prevent calling data in the callback (only metadata is now accessible). Closes spring-projectsgh-23649
This commit makes it possible to send requests without without requiring to call data(Mono.empty()). It clarifies the semantics by renaming ResponseSpec to InteractionSpec in order to leverage more directly RSocket vocabulary and make things more consistent now that RequestSpec extends it. It also improves the Consumer variant of metadata in order to prevent calling data in the callback (only metadata is now accessible). Closes spring-projectsgh-23649
I have worked on that, and here is my proposal: sdeleuze@rsocketrequester-refactoring. This commit makes it possible to send requests without requiring to call It clarifies the semantics by renaming It also improves the Any thoughts @bclozel @rstoyanchev? |
This commit makes it possible to send requests without requiring to call data(Mono.empty()). It clarifies the semantics by renaming ResponseSpec to InteractionSpec in order to leverage more directly RSocket vocabulary and make things more consistent now that RequestSpec extends it. It also improves the Consumer variant of metadata in order to prevent calling data in the callback (only metadata is now accessible). Closes spring-projectsgh-23649
This commit makes it possible to send requests without requiring to call data(Mono.empty()). It introduces a dedicated MetadataSpec interface and merge ResponseSpec into RequestSpec for more flexibility. Closes spring-projectsgh-23649
Current
RSocketRequester
makes it mandatory to useRequestSpec#data
methods in order to reachResponseSpec
methods that allow to perform the exchange. ThisRequestSpec
/ResponseSpec
split seems unnecessary since allResponseSpec
methods can be invoked directly for request without payload, which seems to be a perfectly valid use case.This leads to code like
req.route("find.radar.{iata}", iata).data(Mono.empty()).retrieveMono(AirportLocation.class))
, and the issue is even more impacting in Coroutines world sincedata()
does not acceptnull
.After discussion with @bclozel, our proposal is to merge
RequestSpec
andResponseSpec
in order to avoid this issue. Another hint that they should probably be merged is thatResponseSpec
methods have side effects on the request itself.About the name, maybe we could just use
RequestSpec
, moveResponseSpec
methods in it and removeResponseSpec
.The text was updated successfully, but these errors were encountered: