Amazon.Runtime.Internal.CapacityManager.TryReleaseCapacity C# (CSharp) Method

TryReleaseCapacity() public method

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 TryReleaseCapacity ( bool isRetryRequest, RetryCapacity retryCapacity ) : void
isRetryRequest bool
retryCapacity RetryCapacity Contains the RetryCapacity object for the said ServiceURL.
return void
        public void TryReleaseCapacity(bool isRetryRequest,RetryCapacity retryCapacity) 
        {
            if(isRetryRequest)
            {
                ReleaseCapacity(THROTTLE_RETRY_REQUEST_COST,retryCapacity);
            }
            else
            {
                ReleaseCapacity(THROTTLE_REQUEST_COST,retryCapacity);
            }
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Virtual method that gets called on a success Response. If its a retry success response, the entire
 /// retry acquired capacity is released(default is 5). If its just a success response a lesser value capacity
 /// is released(default is 1).
 /// </summary>
 /// <param name="executionContext">Request context containing the state of the request.</param>
 public override void NotifySuccess(IExecutionContext executionContext)
 {
     if (executionContext.RequestContext.ClientConfig.ThrottleRetries && _retryCapacity != null)
     {
         _capacityManagerInstance.TryReleaseCapacity(executionContext.RequestContext.Retries > 0 ? true:false, _retryCapacity);
     }
 }
All Usage Examples Of Amazon.Runtime.Internal.CapacityManager::TryReleaseCapacity