controller

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 28 Imported by: 2 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 controller advances machines. It reads its inbox and its wakes in the store, takes one step at a time for each instance with something waiting, and writes down the result. Everything it does is a write to the store.

Index

Constants

View Source
const (
	StepTime   = 10 * time.Second
	StepMemory = 1 << 30
)

The limits of a step's process. A step of a small machine takes about 15 ms and 25 MiB.

View Source
const MaxMessage = 256 << 10

MaxMessage is the largest a message may be.

View Source
const StepArg = "step"

StepArg, after the argument that makes the binary run one job, makes it read one step.

Variables

This section is empty.

Functions

func StepMain added in v0.12.0

func StepMain()

StepMain is the whole of a step's process.

Types

type Controller

type Controller struct {
	ID    *identity.Identity
	Store store.Store
	// Now is the controller's clock.
	Now func() time.Time
	// SideBySide bounds how many store requests a pass has open at once,
	// however much is owed.
	SideBySide int
	// AnyRunner has a job carried out whatever tags it names, as under
	// corbie test.
	AnyRunner bool
	// Command starts the process of a step taken in a process of its own;
	// by default, this binary.
	Command []string
	// StepTime is how long that process may run.
	StepTime time.Duration
}

A Controller brings nothing with it but its key. Who it trusts, its trees, the secrets and values set at locations, and every instance are in the store.

func New

func New(id *identity.Identity, s store.Store) *Controller

New makes a controller on a store.

func (*Controller) Pass

func (c *Controller) Pass(ctx context.Context) (next time.Time, err error)

Pass looks at the store, does everything that is owed, and stops. It says when the next thing is due, if it knows of one.

Jump to

Keyboard shortcuts

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