Struct: retry.Standard
Overview
Standard is the standard retry pattern for the SDK. It uses a set of retryable checks to determine of the failed attempt should be retried, and what retry delay should be used.
Implemented Interfaces
types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, retry.IsErrorRetryable, types.MetricsFilter, s3.PresignPost, aws.RetryerV2, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream
Method Summary collapse
-
func (s *Standard) GetAttemptToken(context.Context) (func(error) error, error)
GetAttemptToken returns the token to be released after then attempt completes.
-
func (s *Standard) GetInitialToken() func(error) error
GetInitialToken returns a token for adding the NoRetryIncrement to the RateLimiter token if the attempt completed successfully without error.
-
func (s *Standard) GetRetryToken(ctx context.Context, opErr error) (func(error) error, error)
GetRetryToken attempts to deduct the retry cost from the retry token pool.
-
func (s *Standard) IsErrorRetryable(err error) bool
IsErrorRetryable returns if the error is can be retried or not.
-
func (s *Standard) MaxAttempts() int
MaxAttempts returns the maximum number of attempts that can be made for a request before failing.
-
func (s *Standard) RetryDelay(attempt int, err error) (time.Duration, error)
RetryDelay returns the delay to use before another request attempt is made.
Method Details
func (s *Standard) GetAttemptToken(context.Context) (func(error) error, error)
GetAttemptToken returns the token to be released after then attempt completes. The release token will add NoRetryIncrement to the RateLimiter token pool if the attempt was successful. If the attempt failed, nothing will be done.
222 223 224 |
// File 'aws/retry/standard.go', line 222
|
func (s *Standard) GetInitialToken() func(error) error
GetInitialToken returns a token for adding the NoRetryIncrement to the RateLimiter token if the attempt completed successfully without error.
InitialToken applies to result of the each attempt, including the first. Whereas the RetryToken applies to the result of subsequent attempts.
Deprecated: use GetAttemptToken instead.
233 234 235 |
// File 'aws/retry/standard.go', line 233
|
func (s *Standard) GetRetryToken(ctx context.Context, opErr error) (func(error) error, error)
GetRetryToken attempts to deduct the retry cost from the retry token pool. Returning the token release function, or error.
243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
// File 'aws/retry/standard.go', line 243
|
func (s *Standard) IsErrorRetryable(err error) bool
IsErrorRetryable returns if the error is can be retried or not. Should not consider the number of attempts made.
210 211 212 |
// File 'aws/retry/standard.go', line 210
|
func (s *Standard) MaxAttempts() int
MaxAttempts returns the maximum number of attempts that can be made for a request before failing.
204 205 206 |
// File 'aws/retry/standard.go', line 204
|
func (s *Standard) RetryDelay(attempt int, err error) (time.Duration, error)
RetryDelay returns the delay to use before another request attempt is made.
215 216 217 |
// File 'aws/retry/standard.go', line 215
|