-
Notifications
You must be signed in to change notification settings - Fork 357
Feature/framing #575
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
Feature/framing #575
Conversation
* optimize request channel to let you peak at the first item in the requestChannel Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updated javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updates Signed-off-by: Robert Roeser <rroeserr@gmail.com> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <rroeserr@gmail.com> Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
… PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com>
15f2e6e to
533d597
Compare
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
… PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com>
…o feature/framing
| return new DefaultConnectionSetupPayload(setupFrame); | ||
| } | ||
|
|
||
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.
Are we having some format war? Every PR recently seems to reformat more lines than it changes...
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 didn't run a formatter on purpose I was going to wait till after this pull request and then make the formatter required for a build to pass.
| * @throws NullPointerException if {@code byteBufAllocator} or {@code delegate} are {@code null} | ||
| * @throws IllegalArgumentException if {@code maxFragmentSize} is not {@code positive} | ||
| */ | ||
| *//* |
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.
Do you want to check in this commented code?
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.
yeah - should have added to my pull request that its not quite done yet, and there's a couple things left. I wanted people to start looking at it.
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.
@yschimke just removed one commented block (not this one though), so those will be cleaned out also - one change at a time.
|
|
||
| final class LocalTransportTest implements TransportTest { | ||
|
|
||
| final class LocalTransportTest {// implements TransportTest { |
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.
Is this WIP or you want to land, if the latter can you link to a github issue?
|
Overall the change looks sensible, but I'm probably not the best to give the final shipit. Awkward with review with the large amount of reformatted and also large commented out blocks. |
rsocket-core/src/main/java/io/rsocket/frame/SetupFrameFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/SetupFrameFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/RequestStreamFrameFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/RequestFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/RequestFireAndForgetFrameFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/LeaseFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/LeaseFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/ExtensionFrameFlyweight.java
Outdated
Show resolved
Hide resolved
rsocket-core/src/main/java/io/rsocket/frame/FrameHeaderFlyweight.java
Outdated
Show resolved
Hide resolved
restore micrometer RSocket test Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com>
46e4f5c to
d74e7eb
Compare
release ByteBufs in tests Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com>
2ff24a1 to
b071705
Compare
nebhale
left a comment
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.
Huge improvement in consistency and readability.
|
@mostroverkhov - you good with the changes? Can I merge this? |
|
@robertroeser There is still missing support for fragmentation, but that can be done is follow-up PR |
* Adds specific requestChannel(Payload, Publisher<Payload>) (rsocket#572) * optimize request channel to let you peak at the first item in the requestChannel Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updated javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updates Signed-off-by: Robert Roeser <rroeserr@gmail.com> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <rroeserr@gmail.com> Signed-off-by: Robert Roeser <rroeserr@gmail.com> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixing tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixed some more tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fix frame flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * testing Signed-off-by: Robert Roeser <rroeserr@gmail.com> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com> * javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixing tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixed some more tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * testing Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fix frame flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com> * javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * setup frame flyweight: allow null metadata restore micrometer RSocket test Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com> * apply fixes from review release ByteBufs in tests Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com> Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com>
Originally RSocket didn't use ByteBuf, and the existing frame classes are a legacy of that. This change finishes the framing work @nebhale started, and turns all the Frames into flyweights. It removes the Frame class completely. The frames originally required offsets and this has been replaced using ByteBuf's reader and writer indexes.
Frame length is not long part of the header flyweight. It is a separate flyweight that can be used by transports that require a length. It only needs to be applied to in the duplex connection before sending the frame.
The Payload classes remained unchanged.
Only two things are now recycled - the Payloads, and ByteBufs.
There is an API change in the RSocketFactory. The default remains unchanged but instead of taking a function that turns a ByteBuf into a Payload it now takes a specific type called a PayloadDecoder. There are constants in the interface to a zero copy implementation and a default copying implementation. There is also a method added to let the call specify a ByteBufAllocator if they want to change from ByteBufAllocator.DEFAULT
These changes - aside from RSocketFactory - are transparent.