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.
Current
RSocketRequestermakes it mandatory to useRequestSpec#datamethods in order to reachResponseSpecmethods that allow to perform the exchange. ThisRequestSpec/ResponseSpecsplit seems unnecessary since allResponseSpecmethods 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
RequestSpecandResponseSpecin order to avoid this issue. Another hint that they should probably be merged is thatResponseSpecmethods have side effects on the request itself.About the name, maybe we could just use
RequestSpec, moveResponseSpecmethods in it and removeResponseSpec.