Go to file
Chris Vest 492977d9be Introduce Deref abstraction
Motivation:
Sometimes, we wish to operate on both buffers and anything that can produce a buffer.
For instance, when making a composite buffer, we could compose either buffers or sends.

Modification:
Introduce a Deref interface, which is extended by both Rc and Send.
A Deref can be used to acquire an Rc instance, and in doing so will also acquire a reference to the Rc.
That is, dereferencing increases the reference count.
For Rc itself, this just delegates to Rc.acquire, while for Send it delegates to Send.receive, and can only be called once.
The Allocator.compose method has been changed to take Derefs.
This allows us to compose either Bufs or Sends of bufs.
Or a mix.
Extra care and caution has been added to the code, to make sure the reference counts are managed correctly when composing buffers, now that it's a more complicated operation.
A handful of convenience methods for working with Sends have also been added to the Send interface.

Result:
We can now build a composite buffer out of sends of buffers.
2021-02-11 14:26:57 +01:00
.github/workflows Capture build artifacts for failed builds 2020-12-01 14:38:09 +01:00
src Introduce Deref abstraction 2021-02-11 14:26:57 +01:00
.dockerignore Add a docker-based build 2020-11-18 17:16:37 +01:00
.gitignore Prepare incubator repo for new buffer API 2020-11-17 14:56:28 +01:00
Dockerfile Try a different caching mechanism 2020-11-21 15:26:10 +01:00
Makefile The make clean command now also cleans up after failed build commands 2020-12-11 12:10:04 +01:00
pom.xml The assertj-core dependency should only be available in test scope 2020-11-23 18:11:22 +01:00
README.md Readme file updates 2021-01-05 12:51:17 +01:00

Netty Incubator Buffer API

This repository is incubating a new buffer API proposed for Netty 5.

Building and Testing

Short version: just run make.

The project currently relies on snapshot versions of the Panama Foreign fork of OpenJDK. This allows us to test out the most recent version of the jdk.incubator.foreign APIs, but also make building, and local development more involved. To simplify things, we have a Docker based build, controlled via a Makefile with the following commands:

  • image build the docker image. This includes building a snapshot of OpenJDK, and download all relevant Maven dependencies.
  • test run all tests in a docker container. This implies image. The container is automatically deleted afterwards.
  • dbg drop into a shell in the build container, without running the build itself. The debugging container is not deleted afterwards.
  • clean remove the leftover containers created by dbg, test, and build.
  • build build binaries and run all tests in a container, and copy the target directory out of the container afterwards. This is the default build target.