runner

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 20 Imported by: ? 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

View Source
var (
	ErrWorkerFailed = pyscripts.ErrRunnerFailed
	ErrBusy         = pyscripts.ErrRunnerBusy
	ErrOutputLimit  = pyscripts.ErrOutputLimit
	ErrClosed       = pyscripts.ErrRunnerClosed
)

These name the same failures as the pyscripts errors they wrap, so callers can match on either: code in this package compares against these, and the service and HTTP layers against the exported ones.

Functions

func New

func New(cfg Config, log logger.Logger) (pyscripts.Runner, error)

Types

type Config

type Config struct {
	Python  string
	Workers int
	// Timeout bounds a single run, measured from the moment a worker is obtained.
	Timeout time.Duration
	// AcquireTimeout bounds how long a caller waits for a free worker before the
	// pool sheds the request. Without it a saturated pool queues indefinitely.
	AcquireTimeout time.Duration
	// StartTimeout bounds the handshake with a newly spawned worker, so one
	// that never reports ready cannot hang startup.
	StartTimeout time.Duration
	MaxOutput    int64
	MaxLogLines  int
	BLASThreads  int
	Limits       Limits
}

type Input

type Input = pyscripts.Input

Input and Result are aliased from pyscripts, which owns the contract.

type Limits

type Limits struct {
	CPUSeconds  int   `json:"cpu_seconds"`
	MaxMemory   int64 `json:"max_memory"`
	MaxFileSize int64 `json:"max_file_size"`
}

type Result

type Result = pyscripts.Result

Input and Result are aliased from pyscripts, which owns the contract.

Jump to

Keyboard shortcuts

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