runner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InProcessRunner

type InProcessRunner struct{}

InProcessRunner executes tasks by calling Fn directly in the current process.

func NewInProcessRunner

func NewInProcessRunner() *InProcessRunner

NewInProcessRunner returns a new InProcessRunner.

func (*InProcessRunner) Execute

func (r *InProcessRunner) Execute(ctx context.Context, task Task) (Result, error)

Execute runs the task's Fn with a child context bounded by the task's Timeout. It measures wall-clock duration and returns the result. On error, the error appears both in Result.Error and as the function's error return value.

type Result

type Result struct {
	Output   map[string]any
	Duration time.Duration
	Error    error
}

Result holds the outcome of executing a Task.

type Runner

type Runner interface {
	Execute(ctx context.Context, task Task) (Result, error)
}

Runner executes tasks. The in-process implementation calls Fn directly; future implementations may dispatch to GitHub Actions, Cloud Run Jobs, etc.

type Task

type Task struct {
	Type    string
	Input   map[string]any
	Timeout time.Duration
	Fn      func(ctx context.Context, input map[string]any) (map[string]any, error)
}

Task describes a unit of work to be executed by a Runner.

Jump to

Keyboard shortcuts

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