supervisor

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 15 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

Overview

Package supervisor performs the project work behind the background server's requests for one base directory: starting synchronous and asynchronous runs, and cancelling a synchronous run whose client disconnected. `cancel`, `suspend`, and `resume` do not go through it; they call internal/jobcontrol from the calling process.

It implements server.Operations. internal/server owns the transport, the request protocol, and the server's lifetime; this package decides what each request does, using internal/jobcontrol and internal/projectrun. Messages it returns are plain text that the client colors; it must not parse flags or depend on terminal output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operations

type Operations struct {
	BaseDir string
	// Project is the only project this supervisor runs; empty accepts any,
	// for tests that drive Operations directly.
	Project    string
	Controller jobcontrol.Controller
	Runner     projectrun.Runner
	// NewRunID returns a fresh run ID.
	NewRunID func() string
	// Logf receives events, such as an async run that failed, that have no
	// client to report them to. Nil drops them.
	Logf func(format string, args ...any)
}

Operations performs the requests of the supervisor of Project in BaseDir.

func (Operations) Run

func (ops Operations) Run(request server.Request, progress func(server.Response)) (string, int, error)

Run executes a run inside the supervisor, reporting progress to the attached client, and returns once it has finished.

func (Operations) StartRun

func (ops Operations) StartRun(request server.Request, onDone func()) (string, string, error)

StartRun starts an async run inside the supervisor and returns at once. onDone, if not nil, is called once the run has finished.

Jump to

Keyboard shortcuts

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