Skip to content

Commit

Permalink
Deprecate BufferHandler and BufferHolder (#2452)
Browse files Browse the repository at this point in the history
Motivation:

Both the BufferHandler and the BufferHolder did see very limited use
and are scheduled for removal in the next minor release.

Modifications:

To preserve backwards compatibility and to notify potential users,
both APIs are marked as deprecated now in preparation for removal.
  • Loading branch information
daschl authored Dec 2, 2022
1 parent 2ea43f3 commit 8b414d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

/**
* An object which contains a {@link Buffer}.
*
* @deprecated This API is going to be removed in future releases with no planned replacement. If it cannot be
* removed from your application, consider copying it into your codebase.
*/
@Deprecated // FIXME: 0.43 - Remove deprecation
public interface BufferHolder {
/**
* The buffer contained by this object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public NettyConnection<Buffer, Buffer> connectBlocking(ExecutionContext<?> execu
* @param address to connect.
* @return New {@link NettyConnection}.
*/
@SuppressWarnings("deprecation") // legitimate use of BufferHandler
public Single<NettyConnection<Buffer, Buffer>> connect(ExecutionContext<?> executionContext,
SocketAddress address) {
return TcpConnector.connect(null, address, config, false, executionContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public ServerContext bind(ExecutionContext<?> executionContext, int port,
}

// Visible to allow tests to override.
@SuppressWarnings("deprecation") // legitimate use of BufferHandler
ChannelInitializer getChannelInitializer(final Function<NettyConnection<Buffer, Buffer>, Completable> service,
final ExecutionContext<?> executionContext) {
return channel -> channel.pipeline().addLast(BufferHandler.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@
* </ul>
*
* This also releases any {@link ByteBuf} once converted to {@link Buffer}.
*
* @deprecated This API is going to be removed in future releases with no planned replacement. If it cannot be
* removed from your application, consider copying it into your codebase.
*/
@Sharable
@Deprecated // FIXME: 0.43 - Remove deprecation and copy into tests
public final class BufferHandler extends ChannelDuplexHandler {
public static final ChannelDuplexHandler INSTANCE = new BufferHandler();

Expand Down

0 comments on commit 8b414d8

Please sign in to comment.