Open
Conversation
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.
Support sending a payload with both Next and Complete flags.
Motivation:
Currently - it's impossible to send a payload with both Next and Complete flags when using RequestChannel subscriber.
OnNextcallback sends the payload with Next flag, andOnCompletepayload sends an empty payload with a Complete flag.But that's two separate payloads, not one.
Setting both Next and Complete flags on the final payload is totally valid (as per RSocket spec).
And some implementations (such as Thrift RSocket in C++) in fact require the ability to set both Next and Complete flags on a payload for certain use cases:
https://github.com/facebook/fbthrift/blob/8679ad11edc2a79afa602a55ac4839c524ca36e0/thrift/lib/cpp2/transport/rocket/client/RocketClient.cpp#L699-L700
Modifications:
Add a
FinalPayloadwrapper and some simple logic to allow the user to send a payload with both Next and Complete flags.The behavior is equivalent to calling
OnNextandOnComplete, but only one payload is sent.Result:
The modification allows for interoperability of
rsocket-gowith other rsocket implementations and removed the limitation on Next/Complete flags being set on a payload.