- java.lang.Object
-
- io.netty5.channel.MaxMessagesReadHandleFactory
-
- All Implemented Interfaces:
ReadHandleFactory
- Direct Known Subclasses:
AdaptiveReadHandleFactory,FixedReadHandleFactory,ServerChannelReadHandleFactory
public abstract class MaxMessagesReadHandleFactory extends Object implements ReadHandleFactory
Base implementation ofReadHandleFactorywhich allows to limit the number of messages read per read loop.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classMaxMessagesReadHandleFactory.MaxMessageReadHandleFocuses on enforcing the maximum messages per read condition forMaxMessagesReadHandleFactory.MaxMessageReadHandle.lastRead(int, int, int).-
Nested classes/interfaces inherited from interface io.netty5.channel.ReadHandleFactory
ReadHandleFactory.ReadHandle
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMaxMessagesReadHandleFactory()protectedMaxMessagesReadHandleFactory(int maxMessagesPerRead)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ReadHandleFactory.ReadHandlenewHandle(Channel channel)Creates a new handle for the givenChannel.protected abstract MaxMessagesReadHandleFactory.MaxMessageReadHandlenewMaxMessageHandle(int maxMessagesPerRead)Creates a newMaxMessagesReadHandleFactory.MaxMessageReadHandleto use.
-
-
-
Method Detail
-
newHandle
public final ReadHandleFactory.ReadHandle newHandle(Channel channel)
Description copied from interface:ReadHandleFactoryCreates a new handle for the givenChannel.- Specified by:
newHandlein interfaceReadHandleFactory- Parameters:
channel- theChannelfor which theReadHandleFactory.ReadHandleis used.
-
newMaxMessageHandle
protected abstract MaxMessagesReadHandleFactory.MaxMessageReadHandle newMaxMessageHandle(int maxMessagesPerRead)
Creates a newMaxMessagesReadHandleFactory.MaxMessageReadHandleto use.- Parameters:
maxMessagesPerRead- the maximum number of messages to read per read loop.- Returns:
- the handle.
-
-