Package io.netty.channel.pool
Interface ChannelPool
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
FixedChannelPool,SimpleChannelPool
public interface ChannelPool extends Closeable
Allows to acquire and releaseChanneland so act as a pool of these.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.netty.util.concurrent.Future<Channel>acquire()Acquire aChannelfrom thisChannelPool.io.netty.util.concurrent.Future<Channel>acquire(io.netty.util.concurrent.Promise<Channel> promise)Acquire aChannelfrom thisChannelPool.voidclose()io.netty.util.concurrent.Future<Void>release(Channel channel)Release aChannelback to thisChannelPool.io.netty.util.concurrent.Future<Void>release(Channel channel, io.netty.util.concurrent.Promise<Void> promise)Release aChannelback to thisChannelPool.
-
-
-
Method Detail
-
acquire
io.netty.util.concurrent.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
io.netty.util.concurrent.Future<Channel> acquire(io.netty.util.concurrent.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
io.netty.util.concurrent.Future<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
io.netty.util.concurrent.Future<Void> release(Channel channel, io.netty.util.concurrent.Promise<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 interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-