First, this needs to implement Buffered<ByteBuffer> so it can perform buffered IO in the first place. Next, update the layout encoding to the third form. Maximum memory limits should be set for IO transfers, and the number of transfers should be kept track of. Could reuse ByteBuffers via callbacks (what a fun finite state machine you can make here). Possible options of what to do when memory limit is approached (block, drop, error, etc.). This should also be able to clean up the Phaser usage to an AtomicLong or similar for waiting on close.
First, this needs to implement
Buffered<ByteBuffer>
so it can perform buffered IO in the first place. Next, update the layout encoding to the third form. Maximum memory limits should be set for IO transfers, and the number of transfers should be kept track of. Could reuse ByteBuffers via callbacks (what a fun finite state machine you can make here). Possible options of what to do when memory limit is approached (block, drop, error, etc.). This should also be able to clean up thePhaser
usage to anAtomicLong
or similar for waiting on close.