Skip to content

Commit 5d5fe8b

Browse files
committed
nit: use a lambda
1 parent 49baa4b commit 5d5fe8b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

client/src/main/java/org/asynchttpclient/netty/channel/NettyConnectListener.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
import io.netty.channel.Channel;
3333
import io.netty.handler.codec.http.HttpRequest;
3434
import io.netty.handler.ssl.SslHandler;
35-
import io.netty.util.concurrent.Future;
36-
import io.netty.util.concurrent.GenericFutureListener;
3735

3836
/**
3937
* Non Blocking connect.
@@ -94,12 +92,7 @@ public void onSuccess(Channel channel, InetSocketAddress remoteAddress) {
9492
Object partitionKeyLock = future.takePartitionKeyLock();
9593

9694
if (partitionKeyLock != null) {
97-
channel.closeFuture().addListener(new GenericFutureListener<Future<? super Void>>() {
98-
@Override
99-
public void operationComplete(Future<? super Void> future) throws Exception {
100-
connectionSemaphore.releaseChannelLock(partitionKeyLock);
101-
}
102-
});
95+
channel.closeFuture().addListener(future -> connectionSemaphore.releaseChannelLock(partitionKeyLock));
10396
}
10497
}
10598

0 commit comments

Comments
 (0)