execution

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

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) *Executor

NewExecutor creates a new provider executor with the given provider and run configuration.

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, logger logging.Logger, task config.Task) (providers.Result, error)

Execute runs the task using the configured provider, applying retry logic and rate limiting as configured.

Jump to

Keyboard shortcuts

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