Class CoalescingBufferQueue


  • public final class CoalescingBufferQueue
    extends AbstractCoalescingBufferQueue
    A FIFO queue of bytes where producers add bytes by repeatedly adding Buffer and consumers take bytes in arbitrary lengths. This allows producers to add lots of small buffers and the consumer to take all the bytes out in a single buffer. Conversely, the producer may add larger buffers and the consumer could take the bytes in many small buffers.

    Bytes are added and removed with promises. If the last byte of a buffer added with a promise is removed then that promise will complete when the promise passed to remove(int, io.netty5.util.concurrent.Promise<java.lang.Void>) completes.

    This functionality is useful for aggregating or partitioning writes into fixed size buffers for framing protocols such as HTTP2.