Class CancellableAcquireChannelPool
- java.lang.Object
-
- software.amazon.awssdk.http.nio.netty.internal.CancellableAcquireChannelPool
-
- All Implemented Interfaces:
io.netty.channel.pool.ChannelPool
,Closeable
,AutoCloseable
,SdkChannelPool
public final class CancellableAcquireChannelPool extends Object implements SdkChannelPool
Simple decoratorChannelPool
that attempts to complete the promise given toacquire(Promise)
with the channel acquired from the underlying pool. If it fails (because the promise is already done), the acquired channel is closed then released back to the delegate.
-
-
Constructor Summary
Constructors Constructor Description CancellableAcquireChannelPool(io.netty.util.concurrent.EventExecutor executor, SdkChannelPool delegatePool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.util.concurrent.Future<io.netty.channel.Channel>
acquire()
io.netty.util.concurrent.Future<io.netty.channel.Channel>
acquire(io.netty.util.concurrent.Promise<io.netty.channel.Channel> acquirePromise)
void
close()
CompletableFuture<Void>
collectChannelPoolMetrics(MetricCollector metrics)
Collect channel pool metrics into the providedMetricCollector
collection, completing the returned future when all metric publishing is complete.io.netty.util.concurrent.Future<Void>
release(io.netty.channel.Channel channel)
io.netty.util.concurrent.Future<Void>
release(io.netty.channel.Channel channel, io.netty.util.concurrent.Promise<Void> promise)
-
-
-
Constructor Detail
-
CancellableAcquireChannelPool
public CancellableAcquireChannelPool(io.netty.util.concurrent.EventExecutor executor, SdkChannelPool delegatePool)
-
-
Method Detail
-
acquire
public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire()
- Specified by:
acquire
in interfaceio.netty.channel.pool.ChannelPool
-
acquire
public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire(io.netty.util.concurrent.Promise<io.netty.channel.Channel> acquirePromise)
- Specified by:
acquire
in interfaceio.netty.channel.pool.ChannelPool
-
release
public io.netty.util.concurrent.Future<Void> release(io.netty.channel.Channel channel)
- Specified by:
release
in interfaceio.netty.channel.pool.ChannelPool
-
release
public io.netty.util.concurrent.Future<Void> release(io.netty.channel.Channel channel, io.netty.util.concurrent.Promise<Void> promise)
- Specified by:
release
in interfaceio.netty.channel.pool.ChannelPool
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceio.netty.channel.pool.ChannelPool
- Specified by:
close
in interfaceCloseable
-
collectChannelPoolMetrics
public CompletableFuture<Void> collectChannelPoolMetrics(MetricCollector metrics)
Description copied from interface:SdkChannelPool
Collect channel pool metrics into the providedMetricCollector
collection, completing the returned future when all metric publishing is complete.- Specified by:
collectChannelPoolMetrics
in interfaceSdkChannelPool
- Parameters:
metrics
- The collection to which all metrics should be added.- Returns:
- A future that is completed when all metric publishing is complete.
-
-