retry

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package retry decides which failures are worth another attempt, and how long to wait between them. It knows nothing about what the call was.

Index

Constants

View Source
const DefaultAttempts = 3

DefaultAttempts is how many times a call is made in total, not how many times it is retried. Three is two waits, which is enough to ride out a restart and short enough that a caller's own deadline still means something.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, attempts int, fn func() error) error

Do calls fn until it succeeds, until the error is not worth repeating, or until the attempts run out.

It is the caller's job to make sure fn is safe to repeat. For Submit that means an idempotency key, which the client always sends.

Types

This section is empty.

Jump to

Keyboard shortcuts

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