task

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("the script ran past its time limit and was stopped; tool calls in flight were cancelled; pass a larger timeoutMs or split the work")

Functions

This section is empty.

Types

type ExecutingTask

type ExecutingTask interface {
	Input() Input
	Ok(output string)
	Err(err error)
}

type Input

type Input struct {
	Params
	Context context.Context
}

type Params

type Params struct {
	Name       string
	Script     string
	Comment    string
	Timeout    time.Duration
	Memory     int
	AppendLogs bool
	Controller common.Controller
}

type Result

type Result struct {
	Ok    string
	Async bool
	Err   error
}

type WaitingTask

type WaitingTask interface {
	Name() string
	Memory() int
	Done() <-chan struct{}
	Reject(err error)
	Execute(interrupt func()) (ExecutingTask, bool)
}

func NewTask

func NewTask(params Params, done func(), asyncAfter time.Duration) (WaitingTask, <-chan Result, context.CancelCauseFunc)

Jump to

Keyboard shortcuts

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