deviceapp

package
v0.1.0-alpha.90 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: GPL-3.0 Imports: 7 Imported by: 0 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 deviceapp coordinates the single engine and its device owner across requests, planners, settings changes and shutdown.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lifecycle

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

Lifecycle serializes owner replacement and Stop independently of settings persistence. Stop can cancel a Resume already waiting on a transport.

func (*Lifecycle) Admit

func (l *Lifecycle) Admit(selectOwner func() (string, bool, error), build func() (*motion.Engine, error)) (*motion.Engine, uint64, error)

Admit selects or builds one engine and captures its Stop generation before releasing admission.

func (*Lifecycle) ApplySettings

func (l *Lifecycle) ApplySettings(ctx context.Context, settings config.MotionSettings) error

ApplySettings updates the retained engine, including a paused run.

func (*Lifecycle) Current

func (l *Lifecycle) Current() (*motion.Engine, string)

Current returns a consistent engine/owner pair without waiting for wire I/O.

func (*Lifecycle) Hold

func (l *Lifecycle) Hold() func()

Hold pins the selected engine across a compound admission or safety operation.

func (*Lifecycle) HoldSettings

func (l *Lifecycle) HoldSettings() func()

HoldSettings spans a saved mutation and its runtime transitions.

func (*Lifecycle) Install

func (l *Lifecycle) Install(engine *motion.Engine, owner string)

Install publishes a binding under admission.

func (*Lifecycle) Resume

func (l *Lifecycle) Resume(ctx context.Context, engine *motion.Engine, latest func() config.MotionSettings) (motion.ActiveMotionState, error)

Resume re-reads persisted settings under the same serialization used by edits.

func (*Lifecycle) Retire

func (l *Lifecycle) Retire(ctx context.Context, reason string) error

Retire removes the binding before draining it. The caller holds admission.

func (*Lifecycle) Stop

func (l *Lifecycle) Stop(ctx context.Context, reason string, outside func(string) error, fallback func() (transport.CommandResult, error)) (StopResult, error)

Stop dispatches exactly one of engine Stop or the fallback. The caller holds admission until it publishes completion to any overlapping Stop requests.

type StopResult

type StopResult struct {
	State  motion.ActiveMotionState
	Engine bool
	Result transport.CommandResult
}

StopResult carries the outcome from the engine or the fallback device path.

Jump to

Keyboard shortcuts

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