Class IdleConnectionCountingChannelPool

java.lang.Object
software.amazon.awssdk.http.nio.netty.internal.IdleConnectionCountingChannelPool
All Implemented Interfaces:
io.netty.channel.pool.ChannelPool, Closeable, AutoCloseable, SdkChannelPool

public class IdleConnectionCountingChannelPool extends Object implements SdkChannelPool
A channel pool implementation that tracks the number of "idle" channels in an underlying channel pool.

Specifically, this pool counts the number of channels acquired and then released from/to the underlying channel pool. It will monitor for the underlying channels to be closed, and will remove them from the "idle" count.

  • Constructor Details

    • IdleConnectionCountingChannelPool

      public IdleConnectionCountingChannelPool(io.netty.util.concurrent.EventExecutor executor, io.netty.channel.pool.ChannelPool delegatePool)
  • Method Details

    • acquire

      public io.netty.util.concurrent.Future<io.netty.channel.Channel> acquire()
      Specified by:
      acquire in interface io.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> promise)
      Specified by:
      acquire in interface io.netty.channel.pool.ChannelPool
    • release

      public io.netty.util.concurrent.Future<Void> release(io.netty.channel.Channel channel)
      Specified by:
      release in interface io.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 interface io.netty.channel.pool.ChannelPool
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface io.netty.channel.pool.ChannelPool
      Specified by:
      close in interface Closeable
    • collectChannelPoolMetrics

      public CompletableFuture<Void> collectChannelPoolMetrics(MetricCollector metrics)
      Description copied from interface: SdkChannelPool
      Collect channel pool metrics into the provided MetricCollector collection, completing the returned future when all metric publishing is complete.
      Specified by:
      collectChannelPoolMetrics in interface SdkChannelPool
      Parameters:
      metrics - The collection to which all metrics should be added.
      Returns:
      A future that is completed when all metric publishing is complete.