Update RequestChannel API and first frame handling#146
Merged
jjeffcaii merged 1 commit intorsocket:masterfrom Feb 12, 2026
Merged
Update RequestChannel API and first frame handling#146jjeffcaii merged 1 commit intorsocket:masterfrom
jjeffcaii merged 1 commit intorsocket:masterfrom
Conversation
85a1a38 to
6137590
Compare
6137590 to
d122168
Compare
Member
|
Great work on the code, thanks for the PR! |
meta-codesync bot
pushed a commit
to facebook/fbthrift
that referenced
this pull request
Feb 12, 2026
Summary: rsocket/rsocket-go#146 Reviewed By: podtserkovskiy Differential Revision: D93109728 fbshipit-source-id: 29de69ecfead9341ff39291fa8a3156f9768f17f
meta-codesync bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Feb 12, 2026
Summary: rsocket/rsocket-go#146 Reviewed By: podtserkovskiy Differential Revision: D93109728 fbshipit-source-id: 29de69ecfead9341ff39291fa8a3156f9768f17f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modify
RequestChannelAPI to handle the initial frame/request separately fromFluxfor the subsequent frames.Motivation:
(a) The new API is consistent with all other RSocket methods (which take initial
Payloadas the first argument):https://github.com/echistyakov/rsocket-go/blob/2347d764aefcc0f5584c98a88e5a0637b9e22a0c/internal/socket/abstract_socket.go#L21-L24
(b) The new API fixes a client-side inefficiency/bug for the following case:
With the old API - the server (RS) would subscribe to the sending
Fluxbefore (!!!) seeing the first frame:https://github.com/echistyakov/rsocket-go/blob/2347d764aefcc0f5584c98a88e5a0637b9e22a0c/internal/socket/duplex.go#L642-L646
This would send a
REQUEST_Nframe to the client, making client "think" that the server was requesting additional payloads, even though the server would respond with anERRORsoon after.With the new API - the server (RS) can receive and process the initial request first, before deciding whether to subscribe or respond with
ERRORorCOMPLETEorREQUEST_Nframe.Modifications:
RequestChannelmethod signatures to takePayloadas the first argument.duplex.goandsubscriber_request_channel.goto handle the initial frame similarly toRequestStream(outside ofFlux).Result:
Fluxis now only used for "subsequent" payloads.The initial
REQUEST_CHANNELpayload is handled separately - allowing the server to inspect the initial request before taking any action on theFlux.