- java.lang.Object
-
- io.netty5.channel.DefaultMaxMessagesRecvBufferAllocator
-
- All Implemented Interfaces:
MaxMessagesRecvBufferAllocator
,RecvBufferAllocator
- Direct Known Subclasses:
AdaptiveRecvBufferAllocator
,FixedRecvBufferAllocator
,KQueueGuessRecvBufferAllocator
,ServerChannelRecvBufferAllocator
public abstract class DefaultMaxMessagesRecvBufferAllocator extends Object implements MaxMessagesRecvBufferAllocator
Default implementation ofMaxMessagesRecvBufferAllocator
which respectsChannelOption.AUTO_READ
and also prevents overflow.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DefaultMaxMessagesRecvBufferAllocator.MaxMessageHandle
Focuses on enforcing the maximum messages per read condition forDefaultMaxMessagesRecvBufferAllocator.MaxMessageHandle.continueReading(boolean)
.-
Nested classes/interfaces inherited from interface io.netty5.channel.RecvBufferAllocator
RecvBufferAllocator.Handle
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultMaxMessagesRecvBufferAllocator()
protected
DefaultMaxMessagesRecvBufferAllocator(int maxMessagesPerRead)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
maxMessagesPerRead()
Returns the maximum number of messages to read per read loop.MaxMessagesRecvBufferAllocator
maxMessagesPerRead(int maxMessagesPerRead)
Sets the maximum number of messages to read per read loop.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.RecvBufferAllocator
newHandle
-
-
-
-
Method Detail
-
maxMessagesPerRead
public int maxMessagesPerRead()
Description copied from interface:MaxMessagesRecvBufferAllocator
Returns the maximum number of messages to read per read loop. achannelRead()
event. If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages.- Specified by:
maxMessagesPerRead
in interfaceMaxMessagesRecvBufferAllocator
-
maxMessagesPerRead
public MaxMessagesRecvBufferAllocator maxMessagesPerRead(int maxMessagesPerRead)
Description copied from interface:MaxMessagesRecvBufferAllocator
Sets the maximum number of messages to read per read loop. If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages.- Specified by:
maxMessagesPerRead
in interfaceMaxMessagesRecvBufferAllocator
-
-