Documentation
¶
Overview ¶
Package execution provides unified provider execution patterns for the MindTrial application. It handles common execution concerns such as retry logic, rate limiting, and error handling that are shared between different components like task runners and validators.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackoffWithCallback ¶
func BackoffWithCallback(onBackoff func(nextRetryAttempt uint64, nextDelay time.Duration), next retry.Backoff) retry.Backoff
BackoffWithCallback wraps a retry.Backoff with a callback function that is called before each retry attempt. The callback receives the next retry attempt number and the delay duration.
Types ¶
type Executor ¶
type Executor struct {
Provider providers.Provider
RunConfig config.RunConfig
// contains filtered or unexported fields
}
Executor provides a unified way to execute provider tasks with retry logic and rate limiting.
func NewExecutor ¶
func NewExecutor(provider providers.Provider, runConfig config.RunConfig, sharedLimiter *rate.Limiter) *Executor
NewExecutor creates a new provider executor with the given provider and run configuration. An optional shared rate limiter can be provided to enforce an aggregate rate limit across multiple executors (e.g., all runs within a provider). When both a shared limiter and a per-run limiter are configured, the shared limiter is checked first.