Documentation
¶
Overview ¶
Package run is the body of the internal `peen worker` command.
One worker process serves one session. It reads the launch document its controller handed it, registers over the private socket, builds a session runtime whose durable surface is that socket, and then serves the controller's commands until it is told to stop.
It never opens the controller's SQLite database. Every durable read and write is a protocol call, so the control plane stays the sole owner of durable state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run executes one worker to completion.
It returns when the controller asks the worker to shut down, when the connection ends, or when the context is cancelled. A registration the controller refuses is a terminal failure: the launch this process was given is one the controller will never accept, so retrying would loop.
Types ¶
type Options ¶
type Options struct {
// LaunchInput carries the launch document. Nil reads os.Stdin, which is
// how a control worker receives it without the credential ever appearing in
// the process table or on disk.
LaunchInput io.Reader
// ParseConfig loads the deployment configuration. Nil uses the real
// environment through peenconfig.ParseWorker, which does not require the
// controller's state directory.
ParseConfig func() (peenconfig.Config, error)
// Driver overrides provider construction. Nil discovers the configured
// providers.
Driver agent.DriverFactory
}
Options are the seams a worker run takes. Every field has a production default, so the command itself passes none.