Package io.netty.channel.pool
Interface ChannelPool
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
FixedChannelPool,SimpleChannelPool
public interface ChannelPool extends java.io.CloseableAllows to acquire and releaseChanneland so act as a pool of these.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<Channel>acquire()Acquire aChannelfrom thisChannelPool.Future<Channel>acquire(Promise<Channel> promise)Acquire aChannelfrom thisChannelPool.voidclose()Future<java.lang.Void>release(Channel channel)Release aChannelback to thisChannelPool.Future<java.lang.Void>release(Channel channel, Promise<java.lang.Void> promise)Release aChannelback to thisChannelPool.
-
-
-
Method Detail
-
acquire
Future<Channel> acquire()
Acquire aChannelfrom thisChannelPool. The returnedFutureis notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if theChannelis explicitly closed..
-
acquire
Future<Channel> acquire(Promise<Channel> promise)
Acquire aChannelfrom thisChannelPool. The givenPromiseis notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if theChannelis explicitly closed..
-
release
Future<java.lang.Void> release(Channel channel)
Release aChannelback to thisChannelPool. The returnedFutureis notified once the release is successful and failed otherwise. When failed theChannelwill automatically closed.
-
release
Future<java.lang.Void> release(Channel channel, Promise<java.lang.Void> promise)
Release aChannelback to thisChannelPool. The givenPromiseis notified once the release is successful and failed otherwise. When failed theChannelwill automatically closed.
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-