Package io.netty.channel.uring
Interface IoUringBufferRingAllocator
-
- All Known Implementing Classes:
AbstractIoUringBufferRingAllocator,IoUringAdaptiveBufferRingAllocator,IoUringFixedBufferRingAllocator
public interface IoUringBufferRingAllocatorAllocator that is responsible to allocate buffers for a buffer ring.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ByteBufallocate()Creates a new receive buffer to use by the buffer ring.default voidallocateBatch(java.util.function.Consumer<ByteBuf> consumer, int num)Fill innumofByteBufs.voidlastBytesRead(int attempted, int actual)Set the bytes that have been read for the last read operation that was full-filled out of the buffer ring.
-
-
-
Method Detail
-
allocate
ByteBuf allocate()
Creates a new receive buffer to use by the buffer ring. The returnedByteBufmust be direct.
-
lastBytesRead
void lastBytesRead(int attempted, int actual)Set the bytes that have been read for the last read operation that was full-filled out of the buffer ring.- Parameters:
attempted- the attempted bytes to read.actual- the number of bytes that could be read.
-
allocateBatch
default void allocateBatch(java.util.function.Consumer<ByteBuf> consumer, int num)
- Parameters:
consumer- theConsumerthat will consume the buffers.num- the number of buffers that are passed toConsumer.accept(Object).
-
-