Table of Contents

Class CapacityManager

Namespace
Amazon.Runtime.Internal
Assembly
AWSSDK.Core.dll

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

throttleRetryCount int
throttleRetryCost int
throttleCost int

CapacityManager(int, int, int, int)

public CapacityManager(int throttleRetryCount, int throttleRetryCost, int throttleCost, int timeoutRetryCost)

Parameters

throttleRetryCount int
throttleRetryCost int
throttleCost int
timeoutRetryCost int

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

RetryCapacity

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.CapacityType

Specifies what capacity type cost to use for adding capacity

retryCapacity RetryCapacity

Contains 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 RetryCapacity

Contains the RetryCapacity object for the said ServiceURL.

Returns

bool

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 RetryCapacity

Contains the RetryCapacity object for the said ServiceURL.

capacityType CapacityManager.CapacityType

Specifies what capacity type cost to use for obtaining capacity

Returns

bool

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 bool

if this request is a retry, use a different capacity cost

retryCapacity RetryCapacity

Contains the RetryCapacity object for the said ServiceURL.