-
Notifications
You must be signed in to change notification settings - Fork 351
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
Fixes Payload#hasMetadata to strictly match the flag in the frame #783
Conversation
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.
This looks generally okay but I'd like to suggest some further improvements.
First, (the pre-existing) DataAndMetadataFlyweight#encodeOnlyMetadata
I think is intended for use in frames with metadata only, and therefore it's confusing to have it in DataAndMetadataFlyweight
and now conceptually overlaps with the (newly added) encode
with metadata only. I propose to remove encodeOnlyMetadata
. It is used only in LeaseFrameFlyweight
and it's a one liner, so it can be copied there (like MetaDataPushFrameFlyweight
does it).
For the remaining encode
methods in DataAndMetadataFlyweight
I think they should be consolidated into one method that takes both metadata and data, as well as the hasData
and hasMetadata
flag. This will allow encapsulating the if-else condition that is currently used to decide which encode
to call form multiple places.
Also, following the discussion at the specification thread mentioned earlier, EmptyMetadata should be supported with |
Yes I like having |
Initially that issue was hidden because both sides uses limitRate which does prefetch 256 elements in advance so it is almost impossible to track underflow in request Signed-off-by: Oleh Dokuka <[email protected]>
ensures that ByteBufPayload is not accessible anymore when it has been released Signed-off-by: Oleh Dokuka <[email protected]>
Signed-off-by: Oleh Dokuka <[email protected]>
…ed correctly Right now there was observed a few issues related to that Payload with no metadata was incorrectly incoded so it results to hasMetadata true on the received side Also, optimized the API of Flyweights to ensure that we have common things in one place Signed-off-by: Oleh Dokuka <[email protected]>
Signed-off-by: Oleh Dokuka <[email protected]>
Signed-off-by: Oleh Dokuka <[email protected]>
Signed-off-by: Oleh Dokuka <[email protected]>
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.
LGTM!
Signed-off-by: Oleh Dokuka <[email protected]>
This PR alights with the rsocket/rsocket#302 proposal.
Also, it ensures that ByteBufPayload throws an exception when one tries to use the released instance
Signed-off-by: Oleh Dokuka [email protected]