Interface ChannelPool

All Superinterfaces:
java.lang.AutoCloseable, java.io.Closeable
All Known Implementing Classes:
FixedChannelPool, SimpleChannelPool

public interface ChannelPool extends java.io.Closeable
Allows to acquire and release Channel and so act as a pool of these.
  • Method Details

    • acquire

      Future<Channel> acquire()
      Acquire a Channel from this ChannelPool. The returned Future is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if the Channel is explicitly closed..
    • acquire

      Future<Channel> acquire(Promise<Channel> promise)
      Acquire a Channel from this ChannelPool. The given Promise is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if the Channel is explicitly closed..
    • release

      Future<java.lang.Void> release(Channel channel)
      Release a Channel back to this ChannelPool. The returned Future is notified once the release is successful and failed otherwise. When failed the Channel will automatically closed.
    • release

      Future<java.lang.Void> release(Channel channel, Promise<java.lang.Void> promise)
      Release a Channel back to this ChannelPool. The given Promise is notified once the release is successful and failed otherwise. When failed the Channel will automatically closed.
    • close

      void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable