You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current RSocketRequester makes it mandatory to use RequestSpec#data methods in order to reach ResponseSpec methods that allow to perform the exchange. This RequestSpec / ResponseSpec split seems unnecessary since all ResponseSpec 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 since data() does not accept null.
After discussion with @bclozel, our proposal is to merge RequestSpec and ResponseSpec in order to avoid this issue. Another hint that they should probably be merged is that ResponseSpec methods have side effects on the request itself.
About the name, maybe we could just use RequestSpec, move ResponseSpec methods in it and remove ResponseSpec.
The text was updated successfully, but these errors were encountered:
I think this change aligns nicely with our infrastructure and RSocket in general, because:
unlike its counterpart in WebClient, here the ResponseSpec is not only about how to consume the response, but also about the type of request and RSocket communication pattern we'll use. ResponseSpec has side-effects on RequestSpec.
as @sdeleuze said, none of the RequestSpec methods are mandatory.
The alternative would be to have a noData() in the RequestSpec, but its only goal would be to express the absence of a data() call.
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).
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).
Closesspring-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: