Class CombinedConnectionSemaphore
- java.lang.Object
-
- org.asynchttpclient.netty.channel.PerHostConnectionSemaphore
-
- org.asynchttpclient.netty.channel.CombinedConnectionSemaphore
-
- All Implemented Interfaces:
ConnectionSemaphore
public class CombinedConnectionSemaphore extends PerHostConnectionSemaphore
A combinedConnectionSemaphore
with two limits - a global limit and a per-host limit
-
-
Field Summary
Fields Modifier and Type Field Description protected MaxConnectionSemaphore
globalMaxConnectionSemaphore
-
Fields inherited from class org.asynchttpclient.netty.channel.PerHostConnectionSemaphore
acquireTimeout, freeChannelsPerHost, maxConnectionsPerHost, tooManyConnectionsPerHost
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquireChannelLock(Object partitionKey)
protected long
acquireGlobal(Object partitionKey)
protected long
acquireGlobalTimed(Object partitionKey)
void
releaseChannelLock(Object partitionKey)
protected void
releaseGlobal(Object partitionKey)
-
Methods inherited from class org.asynchttpclient.netty.channel.PerHostConnectionSemaphore
getFreeConnectionsForHost
-
-
-
-
Field Detail
-
globalMaxConnectionSemaphore
protected final MaxConnectionSemaphore globalMaxConnectionSemaphore
-
-
Method Detail
-
acquireChannelLock
public void acquireChannelLock(Object partitionKey) throws IOException
- Specified by:
acquireChannelLock
in interfaceConnectionSemaphore
- Overrides:
acquireChannelLock
in classPerHostConnectionSemaphore
- Throws:
IOException
-
releaseGlobal
protected void releaseGlobal(Object partitionKey)
-
acquireGlobal
protected long acquireGlobal(Object partitionKey) throws IOException
- Throws:
IOException
-
acquireGlobalTimed
protected long acquireGlobalTimed(Object partitionKey) throws IOException
- Throws:
IOException
-
releaseChannelLock
public void releaseChannelLock(Object partitionKey)
- Specified by:
releaseChannelLock
in interfaceConnectionSemaphore
- Overrides:
releaseChannelLock
in classPerHostConnectionSemaphore
-
-