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.