retry

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AttemptMetadataKey = "x-retry-attempt"

Variables

View Source
var (
	// DefaultRetriableCodes default retry code
	DefaultRetriableCodes = []codes.Code{codes.ResourceExhausted, codes.Unavailable}
)

Functions

func Do

func Do(ctx context.Context, call func(ctx context.Context, opts ...grpc.CallOption) error, opts ...grpc.CallOption) error

Types

type CallOption

type CallOption struct {
	grpc.EmptyCallOption // make sure we implement private after() and before() fields so we don't panic.
	// contains filtered or unexported fields
}

CallOption is a grpc.CallOption that is local to grpc retry.

func WithBackoff

func WithBackoff(backoffFunc backoff.Func) *CallOption

WithBackoff sets the `BackoffFunc` used to control time between retries.

func WithCodes

func WithCodes(retryCodes ...codes.Code) *CallOption

WithCodes Allow code to be retried.

func WithDisable

func WithDisable() *CallOption

WithDisable disables the retry behaviour on this call, or this interceptor. It's semantically the same to `WithMax(0)`

func WithMax

func WithMax(maxRetries int) *CallOption

WithMax sets the maximum number of retries on this call, or this interceptor.

func WithPerRetryTimeout

func WithPerRetryTimeout(timeout time.Duration) *CallOption

WithPerRetryTimeout timeout for each retry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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