public final class DefaultChannelPool extends java.lang.Object implements ChannelPool
ChannelPool based on a ConcurrentHashMap| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultChannelPool.PoolLeaseStrategy |
| Constructor and Description |
|---|
DefaultChannelPool(AsyncHttpClientConfig config,
io.netty.util.Timer hashedWheelTimer) |
DefaultChannelPool(int maxIdleTime,
int connectionTtl,
DefaultChannelPool.PoolLeaseStrategy poolLeaseStrategy,
io.netty.util.Timer nettyTimer,
int cleanerPeriod) |
DefaultChannelPool(int maxIdleTime,
int connectionTtl,
io.netty.util.Timer nettyTimer,
int cleanerPeriod) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy all channels that has been cached by this instance.
|
void |
flushPartitions(java.util.function.Predicate<java.lang.Object> predicate)
Flush partitions based on a predicate
|
java.util.Map<java.lang.String,java.lang.Long> |
getIdleChannelCountPerHost() |
boolean |
isOpen()
Return true if a channel can be cached.
|
boolean |
offer(io.netty.channel.Channel channel,
java.lang.Object partitionKey)
Add a channel to the pool
|
io.netty.channel.Channel |
poll(java.lang.Object partitionKey)
Remove the channel associated with the uri.
|
boolean |
removeAll(io.netty.channel.Channel channel)
Remove all channels from the cache.
|
public DefaultChannelPool(AsyncHttpClientConfig config, io.netty.util.Timer hashedWheelTimer)
public DefaultChannelPool(int maxIdleTime,
int connectionTtl,
io.netty.util.Timer nettyTimer,
int cleanerPeriod)
public DefaultChannelPool(int maxIdleTime,
int connectionTtl,
DefaultChannelPool.PoolLeaseStrategy poolLeaseStrategy,
io.netty.util.Timer nettyTimer,
int cleanerPeriod)
public boolean offer(io.netty.channel.Channel channel,
java.lang.Object partitionKey)
offer in interface ChannelPoolchannel - an I/O channelpartitionKey - a key used to retrieve the cached channelpublic io.netty.channel.Channel poll(java.lang.Object partitionKey)
poll in interface ChannelPoolpartitionKey - the partition used when invoking offerpublic boolean removeAll(io.netty.channel.Channel channel)
removeAll in interface ChannelPoolchannel - a channelpublic boolean isOpen()
ChannelPool.offer(Channel, Object)isOpen in interface ChannelPoolpublic void destroy()
destroy in interface ChannelPoolpublic void flushPartitions(java.util.function.Predicate<java.lang.Object> predicate)
ChannelPoolflushPartitions in interface ChannelPoolpredicate - the predicatepublic java.util.Map<java.lang.String,java.lang.Long> getIdleChannelCountPerHost()
getIdleChannelCountPerHost in interface ChannelPoolCopyright © 2017. All Rights Reserved.