gob

package
v0.0.0-...-d996d1d Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableRetries

func DisableRetries(ctx context.Context) context.Context

DisableRetries disables retries for Execute.

func EnableRetries

func EnableRetries(ctx context.Context) context.Context

EnableRetries enables retries for Execute (the default behavior).

func ErrorIsRetriable

func ErrorIsRetriable(err error) bool

ErrorIsRetriable determines whether an error would be retried by Execute.

func Execute

func Execute(ctx context.Context, opName string, fn func() error) error

Execute attempts a GoB operation with retries.

Execute mitigates the effects of short-lived outages and replication lag by retrying operations with certain error codes. The service client's error should be returned in order to correctly detect this situation. The retries will use exponential backoff with a context with the clock tagged with "gob-retry". When performing retries, a log will be emitted that uses opName to identify the operation that is being retried.

Retries will not be performed in the following cases:

  • The provided context is one that has had DisableRetries called on it more recently than EnableRetries
  • The error returned from the operation is tagged with DontRetry

func UseTestClock

func UseTestClock(ctx context.Context) context.Context

Types

This section is empty.

Jump to

Keyboard shortcuts

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