Class PerHostConnectionSemaphore
- java.lang.Object
-
- org.asynchttpclient.netty.channel.PerHostConnectionSemaphore
-
- All Implemented Interfaces:
ConnectionSemaphore
- Direct Known Subclasses:
CombinedConnectionSemaphore
public class PerHostConnectionSemaphore extends Object implements ConnectionSemaphore
Max per-host connections limiter.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
acquireTimeout
protected ConcurrentHashMap<Object,Semaphore>
freeChannelsPerHost
protected int
maxConnectionsPerHost
protected IOException
tooManyConnectionsPerHost
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquireChannelLock(Object partitionKey)
protected Semaphore
getFreeConnectionsForHost(Object partitionKey)
void
releaseChannelLock(Object partitionKey)
-
-
-
Field Detail
-
freeChannelsPerHost
protected final ConcurrentHashMap<Object,Semaphore> freeChannelsPerHost
-
maxConnectionsPerHost
protected final int maxConnectionsPerHost
-
tooManyConnectionsPerHost
protected final IOException tooManyConnectionsPerHost
-
acquireTimeout
protected final int acquireTimeout
-
-
Method Detail
-
acquireChannelLock
public void acquireChannelLock(Object partitionKey) throws IOException
- Specified by:
acquireChannelLock
in interfaceConnectionSemaphore
- Throws:
IOException
-
releaseChannelLock
public void releaseChannelLock(Object partitionKey)
- Specified by:
releaseChannelLock
in interfaceConnectionSemaphore
-
-