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 ¶
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
Click to show internal directories.
Click to hide internal directories.