C# Class Amazon.Runtime.Internal.CapacityManager

This class is responsible for keeping track of Retry capacity across different ServiceURLs.
Inheritance: IDisposable
Show file Open project: aws/aws-sdk-net Class Usage Examples

Public Methods

Method Description
CapacityManager ( int throttleRetryCount, int throttleRetryCost, int throttleCost ) : System
Dispose ( ) : void
GetRetryCapacity ( string serviceURL ) : RetryCapacity

Ths method fetches the RetryCapacity for the given ServiceURL from CapacityManager.CapacityContainer

TryAcquireCapacity ( RetryCapacity retryCapacity ) : bool

This method acquires a said retry capacity if the container has the capacity.

TryReleaseCapacity ( bool isRetryRequest, RetryCapacity retryCapacity ) : void

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.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
AddNewRetryCapacity ( string serviceURL ) : RetryCapacity
ReleaseCapacity ( int capacity, RetryCapacity retryCapacity ) : void

This method releases capacity back. This is invoked by the TryReleaseCapacity method.

TryGetRetryCapacity ( string key, RetryCapacity &value ) : bool

Method Details

CapacityManager() public method

public CapacityManager ( int throttleRetryCount, int throttleRetryCost, int throttleCost ) : System
throttleRetryCount int
throttleRetryCost int
throttleCost int
return System

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GetRetryCapacity() public method

Ths method fetches the RetryCapacity for the given ServiceURL from CapacityManager.CapacityContainer
public GetRetryCapacity ( string serviceURL ) : RetryCapacity
serviceURL string
return RetryCapacity

TryAcquireCapacity() public method

This method acquires a said retry capacity if the container has the capacity.
public TryAcquireCapacity ( RetryCapacity retryCapacity ) : bool
retryCapacity RetryCapacity Contains the RetryCapacity object for the said ServiceURL.
return bool

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