run

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 17 Imported by: 0

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

func Run(ctx context.Context, options Options) error

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 native 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.

Jump to

Keyboard shortcuts

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