Class CapacityManager
This class is responsible for keeping track of Retry capacity across different ServiceURLs.
public class CapacityManager : IDisposable
- Inheritance
-
CapacityManager
- Implements
- Inherited Members
Constructors
CapacityManager(int, int, int)
public CapacityManager(int throttleRetryCount, int throttleRetryCost, int throttleCost)
Parameters
CapacityManager(int, int, int, int)
public CapacityManager(int throttleRetryCount, int throttleRetryCost, int throttleCost, int timeoutRetryCost)
Parameters
Methods
Dispose()
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
GetRetryCapacity(string)
Ths method fetches the RetryCapacity for the given ServiceURL from CapacityManager.CapacityContainer
public RetryCapacity GetRetryCapacity(string serviceURL)
Parameters
serviceURL
string
Returns
ReleaseCapacity(CapacityType, RetryCapacity)
This method calls a method to release capacity back based on whether it was a successful response or a successful retry response. This is invoked by a retry request response.
public void ReleaseCapacity(CapacityManager.CapacityType capacityType, RetryCapacity retryCapacity)
Parameters
capacityType
CapacityManager.CapacityTypeSpecifies what capacity type cost to use for adding capacity
retryCapacity
RetryCapacityContains the RetryCapacity object for the said ServiceURL.
TryAcquireCapacity(RetryCapacity)
This method acquires a said retry capacity if the container has the capacity.
public bool TryAcquireCapacity(RetryCapacity retryCapacity)
Parameters
retryCapacity
RetryCapacityContains the RetryCapacity object for the said ServiceURL.
Returns
TryAcquireCapacity(RetryCapacity, CapacityType)
This method acquires a said retry capacity if the container has the capacity.
public bool TryAcquireCapacity(RetryCapacity retryCapacity, CapacityManager.CapacityType capacityType)
Parameters
retryCapacity
RetryCapacityContains the RetryCapacity object for the said ServiceURL.
capacityType
CapacityManager.CapacityTypeSpecifies what capacity type cost to use for obtaining capacity
Returns
TryReleaseCapacity(bool, RetryCapacity)
This method calls a method to release capacity back based on whether it was a successful response or a successful retry response. This is invoked by a retry request response.
[Obsolete("This method is no longer used in favor of allowing the caller to specify the type of capacity to release.")]
public void TryReleaseCapacity(bool isRetryRequest, RetryCapacity retryCapacity)
Parameters
isRetryRequest
boolif this request is a retry, use a different capacity cost
retryCapacity
RetryCapacityContains the RetryCapacity object for the said ServiceURL.