executor

package
v0.0.0-...-4a57d31 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Parallel    int
	LogDir      string
	GracePeriod time.Duration
	InheritEnv  []string
}

Config holds executor settings.

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor runs job commands with bounded parallelism.

func New

func New(cfg Config) (*Executor, error)

New creates an executor.

func (*Executor) LogDir

func (e *Executor) LogDir() string

LogDir returns the log directory for this executor session.

func (*Executor) Results

func (e *Executor) Results() <-chan Result

Results returns the channel that receives job completion results.

func (*Executor) Run

func (e *Executor) Run(id, command string, env map[string]string, cwd string, timeout time.Duration, runCount int) string

Run starts a job instance asynchronously. Returns the log file path immediately.

func (*Executor) Shutdown

func (e *Executor) Shutdown()

Shutdown cancels all running jobs and waits for them to finish.

type Result

type Result struct {
	ID       string
	ExitCode int
	Err      error
	LogFile  string
}

Result is sent when a job finishes.

Jump to

Keyboard shortcuts

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