Help us shape the future of Go! Take the 2026 Go Developer Survey

device_flowgraph

package
v0.57.29 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package device_flowgraph runs the Flowgraph nodes placed on this Device.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForgeWorkerWatch

type ForgeWorkerWatch struct {
	// contains filtered or unexported fields
}

ForgeWorkerWatch holds the Forge Worker declaration of the accepted forge-worker node and the key of the Device that hosts it. The Reconciler sets it; the plugin host reads it. Each change to either value is a new revision.

func NewForgeWorkerWatch

func NewForgeWorkerWatch() *ForgeWorkerWatch

NewForgeWorkerWatch constructs a ForgeWorkerWatch declaring no Worker.

func (*ForgeWorkerWatch) Set

func (w *ForgeWorkerWatch) Set(deviceKey string, declaration *s4wave_device.ForgeWorkerDeclaration)

Set replaces the Device key and declaration, and wakes the watchers when either changed. A nil declaration declares no Worker.

func (*ForgeWorkerWatch) WaitForgeWorker

func (w *ForgeWorkerWatch) WaitForgeWorker(ctx context.Context, last uint64) ([]byte, string, uint64, error)

WaitForgeWorker returns the encoded declaration, the Device key and the revision once the revision differs from last. A zero last returns the current value at once. The declaration is empty while no Worker is declared.

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler runs the Flowgraph nodes placed on one Device. It watches the World state each pass read and the DevicePolicy for the allowed node types, compiles each allowed node through its node type, applies the compiled entries as one ConfigSet on the Device Session's bus, and writes each node's state into the Device object. A node that fails shows as rejected with its error while the other nodes keep running. The daemon is the only writer of the Device object.

func NewReconciler

func NewReconciler(
	le *logrus.Entry,
	b bus.Bus,
	engine world.Engine,
	policy *device_policy.PolicyStore,
	forgeWorker *ForgeWorkerWatch,
	deviceKey, peerID string,
	hold func() func(),
) *Reconciler

NewReconciler constructs a Reconciler for the Device at deviceKey with the given peer ID. It calls hold while a node runs and calls the release it returns once none do.

func (*Reconciler) Run

func (r *Reconciler) Run(ctx context.Context) error

Run reconciles until ctx ends, then releases every node's configs and withdraws the Forge Worker declaration.

Jump to

Keyboard shortcuts

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