Package org.asynchttpclient.channel
Interface ChannelPool
- 
- All Known Implementing Classes:
- DefaultChannelPool,- NoopChannelPool
 
 public interface ChannelPool
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddestroy()Destroy all channels that has been cached by this instance.voidflushPartitions(Predicate<Object> predicate)Flush partitions based on a predicateMap<String,Long>getIdleChannelCountPerHost()booleanisOpen()Return true if a channel can be cached.booleanoffer(io.netty.channel.Channel channel, Object partitionKey)Add a channel to the pool@Nullable io.netty.channel.Channelpoll(Object partitionKey)Remove the channel associated with the uri.booleanremoveAll(io.netty.channel.Channel channel)Remove all channels from the cache.
 
- 
- 
- 
Method Detail- 
offerboolean offer(io.netty.channel.Channel channel, Object partitionKey)Add a channel to the pool- Parameters:
- channel- an I/O channel
- partitionKey- a key used to retrieve the cached channel
- Returns:
- true if added.
 
 - 
poll@Nullable @Nullable io.netty.channel.Channel poll(Object partitionKey) Remove the channel associated with the uri.- Parameters:
- partitionKey- the partition used when invoking offer
- Returns:
- the channel associated with the uri
 
 - 
removeAllboolean removeAll(io.netty.channel.Channel channel) Remove all channels from the cache. A channel might have been associated with several uri.- Parameters:
- channel- a channel
- Returns:
- the true if the channel has been removed
 
 - 
isOpenboolean isOpen() Return true if a channel can be cached. An implementation can decide based on some rules to allow caching Calling this method is equivalent of checking the returned value ofoffer(Channel, Object)- Returns:
- true if a channel can be cached.
 
 - 
destroyvoid destroy() Destroy all channels that has been cached by this instance.
 - 
flushPartitionsvoid flushPartitions(Predicate<Object> predicate) Flush partitions based on a predicate- Parameters:
- predicate- the predicate
 
 
- 
 
-