C# Class Amazon.Runtime.RetryPolicy

A retry policy specifies all aspects of retry behavior. This includes conditions when the request should be retried, checks of retry limit, preparing the request before retry and introducing delay (backoff) before retries.
ファイルを表示 Open project: aws/aws-sdk-net

Public Methods

Method Description
CanRetry ( IExecutionContext executionContext ) : bool

Returns true if the request is in a state where it can be retried, else false.

NotifySuccess ( IExecutionContext executionContext ) : void

Virtual method that gets called on a successful request response.

OnRetry ( IExecutionContext executionContext ) : bool

Virtual method that gets called before a retry request is initiated. The value returned is True by default(retry throttling feature is disabled).

Retry ( IExecutionContext executionContext, Exception exception ) : bool

Checks if a retry should be performed with the given execution context and exception.

RetryAsync ( IExecutionContext executionContext, Exception exception ) : Task

Checks if a retry should be performed with the given execution context and exception.

RetryForException ( IExecutionContext executionContext, Exception exception ) : bool

Return true if the request should be retried for the given exception.

RetryForExceptionAsync ( IExecutionContext executionContext, Exception exception ) : Task

Return true if the request should be retried for the given exception.

RetryLimitReached ( IExecutionContext executionContext ) : bool

Checks if the retry limit is reached.

WaitBeforeRetry ( IExecutionContext executionContext ) : void

Waits before retrying a request.

WaitBeforeRetryAsync ( IExecutionContext executionContext ) : Task

Waits before retrying a request.

Private Methods

Method Description
GetWebData ( AmazonServiceException ase ) : IWebResponseData
IsClockskew ( IExecutionContext executionContext, Exception exception ) : bool
RetrySync ( IExecutionContext executionContext, Exception exception ) : bool?

Perform the processor-bound portion of the Retry logic. This is shared by the sync, async, and APM versions of the Retry method.

TryParseDateHeader ( AmazonServiceException ase, DateTime &serverTime ) : bool
TryParseExceptionMessage ( AmazonServiceException ase, DateTime &serverTime ) : bool

Method Details

CanRetry() public abstract method

Returns true if the request is in a state where it can be retried, else false.
public abstract CanRetry ( IExecutionContext executionContext ) : bool
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
return bool

NotifySuccess() public method

Virtual method that gets called on a successful request response.
public NotifySuccess ( IExecutionContext executionContext ) : void
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
return void

OnRetry() public method

Virtual method that gets called before a retry request is initiated. The value returned is True by default(retry throttling feature is disabled).
public OnRetry ( IExecutionContext executionContext ) : bool
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
return bool

Retry() public method

Checks if a retry should be performed with the given execution context and exception.
public Retry ( IExecutionContext executionContext, Exception exception ) : bool
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
exception Exception The exception throw after issuing the request.
return bool

RetryAsync() public method

Checks if a retry should be performed with the given execution context and exception.
public RetryAsync ( IExecutionContext executionContext, Exception exception ) : Task
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
exception Exception The exception throw after issuing the request.
return Task

RetryForException() public abstract method

Return true if the request should be retried for the given exception.
public abstract RetryForException ( IExecutionContext executionContext, Exception exception ) : bool
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
exception Exception The exception thrown by the previous request.
return bool

RetryForExceptionAsync() public abstract method

Return true if the request should be retried for the given exception.
public abstract RetryForExceptionAsync ( IExecutionContext executionContext, Exception exception ) : Task
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
exception Exception The exception thrown by the previous request.
return Task

RetryLimitReached() public abstract method

Checks if the retry limit is reached.
public abstract RetryLimitReached ( IExecutionContext executionContext ) : bool
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
return bool

WaitBeforeRetry() public abstract method

Waits before retrying a request.
public abstract WaitBeforeRetry ( IExecutionContext executionContext ) : void
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
return void

WaitBeforeRetryAsync() public abstract method

Waits before retrying a request.
public abstract WaitBeforeRetryAsync ( IExecutionContext executionContext ) : Task
executionContext IExecutionContext The execution context which contains both the /// requests and response context.
return Task