Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Conversation

@chrisvest
Copy link
Member

@chrisvest chrisvest commented Feb 24, 2021

Motivation:
This makes it possible to use the new buffer API in Netty as is.

Modification:
Make the MemSegBuffer implementation class implement ByteBufConvertible and ReferenceCounted.
The produced ByteBuf instance delegates all calls to the underlying Buffer instance as faithfully as possible.
One area where the two deviates, is that it's not possible to create non-retained duplicates and slices with the new buffer API.

Result:
It is now possible to use the new buffer API on both client and server side.
The Echo* examples demonstrate this, and the EchoIT proves it with a test.
The API is used more directly on the client side, since the server-side allocator in Netty does not know how to allocate buffers with the incubating API.

This is the companion PR to netty/netty#11036

Motivation:
This makes it possible to use the new buffer API in Netty as is.

Modification:
Make the MemSegBuffer implementation class implement AsByteBuf and ReferenceCounted.
The produced ByteBuf instance delegates all calls to the underlying Buffer instance as faithfully as possible.
One area where the two deviates, is that it's not possible to create non-retained duplicates and slices with the new buffer API.

Result:
It is now possible to use the new buffer API on both client and server side.
The Echo* examples demonstrate this, and the EchoIT proves it with a test.
The API is used more directly on the client side, since the server-side allocator in Netty does not know how to allocate buffers with the incubating API.
@chrisvest chrisvest force-pushed the bytebuf-integration branch from a18e320 to 78f04ee Compare March 1, 2021 10:21
@chrisvest chrisvest merged commit 1d73f65 into main Mar 1, 2021
@chrisvest chrisvest deleted the bytebuf-integration branch March 1, 2021 10:32
@chrisvest
Copy link
Member Author

GitHub Actions is having an outage. Build passes locally.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant