Documentation
¶
Overview ¶
Package retry implements exponential backoff retry logic for failed beads.
When a Smith worker fails, retry determines whether the bead should be retried. After max retries are exhausted, the bead is marked as needs_human.
Backoff schedule (default):
Attempt 1: 5 minutes Attempt 2: 15 minutes Attempt 3: 45 minutes (final, then needs_human)
Index ¶
Constants ¶
View Source
const ( // DefaultMaxRetries is the default number of retry attempts. DefaultMaxRetries = 2 // DefaultBaseDelay is the base delay for the first retry. DefaultBaseDelay = 5 * time.Minute // DefaultMultiplier is the backoff multiplier between retries. DefaultMultiplier = 3.0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decision ¶
type Decision struct {
ShouldRetry bool // Whether to retry
Delay time.Duration // How long to wait before retrying
Attempt int // Which attempt this would be (1-based)
NeedsHuman bool // If true, bead has exhausted retries
Reason string // Human-readable explanation
}
Decision represents the outcome of evaluating a retry.
type Policy ¶
type Policy struct {
MaxRetries int // Maximum number of retries (0 = no retries)
BaseDelay time.Duration // Delay before first retry
Multiplier float64 // Multiplier for each subsequent retry
}
Policy defines the retry behavior for failed beads.
type RetryEntry ¶
type RetryEntry struct {
BeadID string // The bead being retried
Anvil string // Anvil the bead belongs to
RetryCount int // Number of retries so far
NextRetryAt time.Time // When to retry next (zero = now or expired)
NeedsHuman bool // If true, retries exhausted
LastError string // The error from the last attempt
}
RetryEntry tracks retry state for a specific bead.
func (RetryEntry) IsReady ¶
func (e RetryEntry) IsReady() bool
IsReady returns true if the retry entry is due for its next attempt.
Click to show internal directories.
Click to hide internal directories.