-
Notifications
You must be signed in to change notification settings - Fork 356
Duplex interactions #216
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
Duplex interactions #216
Conversation
#### Problem Duplex interactions (server sending requests to the client) are broken. #### Modification - `ReactiveSocketServer` wasn't using `ClientServerInputMultiplexer` to split input into client and server sockets. This made the responses sent from the client to not reach `ClientReactiveSocket`. Modified `ReactiveSocketServer` to use `ClientServerInputMultiplexer`. - `ClientReactiveSocket` didn't handle a request-stream/channel request before transport subscription arrived. Now using a buffering subscription to buffer request-n and cancel till transport subscription arrives. - Added `DuplexClient` example to demonstrate duplex interactions. #### Result Duplex interactions works!
\cc @benjchristensen |
Since I don't know the surrounding code super well, I have to trust you on most of this. For example, However, it seems to fix the problem so should be merged. |
Throwable::printStackTrace, | ||
StreamIdSupplier.serverSupplier(), | ||
KeepAliveProvider.never()); | ||
LeaseHonoringSocket lhs = new DefaultLeaseHonoringSocket(sender); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The oddity here is that there is no way today in the protocol where a server can tell whether it will honor leases from the client. Probably this should piggy back on the client will honor lease in the setup saying if a client honors lease, server will too.
I am interested in hearing what others think about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmontgomery Your input would be useful on this I imagine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it even make sense for a client responder to use leases? Either it can take requests or it can't (reject/fail). For example, a server-mobile relationship doesn't make sense for leases, as once a mobile client is connected, it only has that one connection to send requests over. Leases really only make sense in server-server situations where a requesting server has multiple connections open and can send requests to different servers depending on their leases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's an oversight.
We could decide that the server will match the configuration of the client.
👍 |
Revision of how request fragmentation will be done with PAYLOAD frames as per discussion in rsocket/rsocket#198
Problem
Duplex interactions (server sending requests to the client) are broken.
Modification
ReactiveSocketServer
wasn't usingClientServerInputMultiplexer
to split input into client and server sockets. This made the responses sent from the client to not reachClientReactiveSocket
. ModifiedReactiveSocketServer
to useClientServerInputMultiplexer
.ClientReactiveSocket
didn't handle a request-stream/channel request before transport subscription arrived. Now using a buffering subscription to buffer request-n and cancel till transport subscription arrives.DuplexClient
example to demonstrate duplex interactions.Result
Duplex interactions works!