Documentation
¶
Overview ¶
Package enginestart gives a command a client connected to the machine's engine, starting the engine first when it is not running, and stops it on request. Map and check commands never use it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect returns a client connected to the engine on o.Dir, which has answered engine.status. When no engine answers it starts one, and when the engine it reached was just exiting idle it starts one again, once.
func Start ¶
Start starts the engine on o.Dir unless one already answers, and returns once an engine answers engine.status. started is true only when the engine that answers is a child this call spawned. Two Starts at once leave one engine: the lock decides, and a child that lost it is spawned again, 100ms apart, until an engine answers or 5s pass.
Types ¶
type Options ¶
type Options struct {
Dir string // the engine's directory, absolute
Idle time.Duration // the started engine's idle time; ≤ 0 means engine.DefaultIdle
// Command builds the engine's process for dir and idle. nil runs this
// executable as `engine run --dir <dir> --idle <idle>`.
Command func(dir string, idle time.Duration) *exec.Cmd
}
Options say which engine to connect to and how to start it.