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 releaseChannel
and so act as a pool of these.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<Channel>
acquire()
Acquire aChannel
from thisChannelPool
.Future<Channel>
acquire(Promise<Channel> promise)
Acquire aChannel
from thisChannelPool
.void
close()
Future<Void>
release(Channel channel)
Release aChannel
back to thisChannelPool
.Future<Void>
release(Channel channel, Promise<Void> promise)
Release aChannel
back to thisChannelPool
.
-
-
-
Method Detail
-
acquire
Future<Channel> acquire()
Acquire aChannel
from thisChannelPool
. The returnedFuture
is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if theChannel
is explicitly closed..
-
acquire
Future<Channel> acquire(Promise<Channel> promise)
Acquire aChannel
from thisChannelPool
. The givenPromise
is notified once the acquire is successful and failed otherwise. Its important that an acquired is always released to the pool again, even if theChannel
is explicitly closed..
-
release
Future<Void> release(Channel channel)
Release aChannel
back to thisChannelPool
. The returnedFuture
is notified once the release is successful and failed otherwise. When failed theChannel
will automatically closed.
-
release
Future<Void> release(Channel channel, Promise<Void> promise)
Release aChannel
back to thisChannelPool
. The givenPromise
is notified once the release is successful and failed otherwise. When failed theChannel
will automatically closed.
-
close
void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-