public final class CancellableAcquireChannelPool extends Object implements SdkChannelPool
ChannelPool
that attempts to complete the promise
given to acquire(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 and Description |
---|
CancellableAcquireChannelPool(io.netty.util.concurrent.EventExecutor executor,
SdkChannelPool delegatePool) |
Modifier and Type | Method and 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 provided
MetricCollector 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) |
public CancellableAcquireChannelPool(io.netty.util.concurrent.EventExecutor executor, SdkChannelPool delegatePool)
public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire()
acquire
in interface io.netty.channel.pool.ChannelPool
public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire(io.netty.util.concurrent.Promise<io.netty.channel.Channel> acquirePromise)
acquire
in interface io.netty.channel.pool.ChannelPool
public io.netty.util.concurrent.Future<Void> release(io.netty.channel.Channel channel)
release
in interface io.netty.channel.pool.ChannelPool
public io.netty.util.concurrent.Future<Void> release(io.netty.channel.Channel channel, io.netty.util.concurrent.Promise<Void> promise)
release
in interface io.netty.channel.pool.ChannelPool
public void close()
close
in interface io.netty.channel.pool.ChannelPool
close
in interface Closeable
close
in interface AutoCloseable
public CompletableFuture<Void> collectChannelPoolMetrics(MetricCollector metrics)
SdkChannelPool
MetricCollector
collection, completing the returned future when
all metric publishing is complete.collectChannelPoolMetrics
in interface SdkChannelPool
metrics
- The collection to which all metrics should be added.Copyright © 2020. All rights reserved.