Skip to content
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

NEXT+COMPLETE RequestResponse Efficiency #9

Closed
benjchristensen opened this issue Jul 27, 2015 · 4 comments
Closed

NEXT+COMPLETE RequestResponse Efficiency #9

benjchristensen opened this issue Jul 27, 2015 · 4 comments

Comments

@benjchristensen
Copy link
Contributor

Currently request/response requires 2 messages to complete (NEXT + COMPLETE): ;https://github.com/ReactiveSocket/reactivesocket-java/blob/e38b757ca02e597712139dfb9d01ba5dc7079c40/src/main/java/io/reactivesocket/ReactiveSocketServerProtocol.java#L105

The protocol design will support multiple headers (types) being sent in a single frame.

  1. We need to at least get NEXT and COMPLETE together in a single frame.
  2. Is there a more efficient way to do this in the Java implementation? A stream of 2 can not be optimized like a scalar, synchronous Observable of 1 so will have a higher cost as currently implemented. Capturing NEXT then COMPLETE and knowing to batch them together is more difficult than a special type, such as NEXT_COMPLETE.

I'm not suggesting the network protocol needs a new type, only that we figure out the optimization in Java.

@tmontgomery
Copy link
Contributor

If the responder can package a NEXT and COMPLETE together to hand to the protocol together, then the protocol can batch them into a single frame trivially.

@NiteshKant
Copy link
Contributor

Since we know by stream initiation that a particular request is request-response, do we even need a complete event. Complete is implicit upon receiving a complete data frame(s) including fragmented frames.

@tmontgomery
Copy link
Contributor

@NiteshKant true. For REQUEST_RESPONSE, there is only a single NEXT. If that is the semantic, could possibly collapse it down to just a completed and reassembled NEXT. I.e. a NEXT with the END bit set.

@benjchristensen
Copy link
Contributor Author

Implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants