retry

package
v1.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultEligibilityStrategy

type DefaultEligibilityStrategy struct{}

func (DefaultEligibilityStrategy) IsEligibleForRetry

func (s DefaultEligibilityStrategy) IsEligibleForRetry(props StrategyProps) bool

type EligibilityStrategy

type EligibilityStrategy interface {
	// IsEligibleForRetry Determines whether a grpc call is able to be retried. The determination is based on the result
	// of the last invocation of the call and whether the call is idempotent.
	IsEligibleForRetry(props StrategyProps) bool
}

type Strategy

type Strategy interface {
	// DetermineWhenToRetry Determines whether a grpc call can be retried and how long to wait before that retry.
	//
	// RetryableProps - Information about the grpc call, its last invocation, and how many times the call
	//            has been made.
	//
	// Returns The time in seconds before the next retry should occur or nil if no retry should be attempted.
	DetermineWhenToRetry(props StrategyProps) *int
}

func NewFixedCountRetryStrategy

func NewFixedCountRetryStrategy(logFactory logger.MomentoLoggerFactory) Strategy

func NewNeverRetryStrategy added in v1.5.0

func NewNeverRetryStrategy() Strategy

NewNeverRetryStrategy is a retry strategy that never retries any request

type StrategyProps

type StrategyProps struct {
	GrpcStatusCode codes.Code
	GrpcMethod     string
	AttemptNumber  int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL