Clarify deprecation docs a bit. (#8226)

Motivation:

It seems to sometimes confuse people what to do to replace setMaxMessagePerRead(...).

Modifications:

Add some more details to the javadocs about the correct replacement.

Result:

Related to https://github.com/netty/netty/issues/8214.
This commit is contained in:
Norman Maurer 2018-08-25 08:14:38 +02:00 committed by GitHub
parent 37a4f99f25
commit 1bd9e662dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -121,7 +121,8 @@ public interface ChannelConfig {
ChannelConfig setConnectTimeoutMillis(int connectTimeoutMillis);
/**
* @deprecated Use {@link MaxMessagesRecvByteBufAllocator}
* @deprecated Use {@link MaxMessagesRecvByteBufAllocator} and
* {@link MaxMessagesRecvByteBufAllocator#maxMessagesPerRead()}.
* <p>
* Returns the maximum number of messages to read per read loop.
* a {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event.
@ -131,7 +132,8 @@ public interface ChannelConfig {
int getMaxMessagesPerRead();
/**
* @deprecated Use {@link MaxMessagesRecvByteBufAllocator}
* @deprecated Use {@link MaxMessagesRecvByteBufAllocator} and
* {@link MaxMessagesRecvByteBufAllocator#maxMessagesPerRead(int)}.
* <p>
* 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.

View File

@ -78,6 +78,7 @@ public class ChannelOption<T> extends AbstractConstant<ChannelOption<T>> {
public static final ChannelOption<Integer> CONNECT_TIMEOUT_MILLIS = valueOf("CONNECT_TIMEOUT_MILLIS");
/**
* @deprecated Use {@link MaxMessagesRecvByteBufAllocator}
* and {@link MaxMessagesRecvByteBufAllocator#maxMessagesPerRead(int)}.
*/
@Deprecated
public static final ChannelOption<Integer> MAX_MESSAGES_PER_READ = valueOf("MAX_MESSAGES_PER_READ");