net.transform.aggregator

A buffer aggregator, when a number of smaller ByteBuf instances need to be aggregated over a larger CompositeByteBuf instance.

These aggregated views rely on the underlying buf and handle memory accounting for it, releasing the aggregated view will release the underlying buffers they are composed of.

aggregate

(aggregate store buf max-size)

Offer a new buffer for aggregation, yielding a vector of bytes kept and buffers to yield if any. We may yield several buffers if the aggregation size is smaller than the buffer we were offered.

aggregator

(aggregator max-size)

Facility function to create an aggregator which yields a single collection of ByteBuf instances.

default-aggregator

Aggregate to the optimal blob size by default.

default-chunk-size

Documentation suggests 16 mega bytes is the ideal size.

raw-aggregator

(raw-aggregator max-size)

A transducer that yields collections of ByteBuf instances from another collection of ByteBuf instances, in the output collection all but the last element of the collection will contain ByteBuf instances of max-size bytes. The last one may be smaller.