controlled

package
v0.0.0-...-9159377 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPrematureShutdown = errors.New("sensor shutdown before monitor stop")

Functions

This section is empty.

Types

type Sensor

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

func NewSensor

func NewSensor(
	ctx context.Context,
	exe execution.Interface,
	newMonitor monitor.NewCompositeMonitorFunc,
	del mondel.Publisher,
	artifactor artifact.Processor,
	workDir string,
	mountPoint string,
) *Sensor

func (*Sensor) Run

func (s *Sensor) Run() error

Sensor can be in two interchanging (and mutually exclusive) "states":

  • (I) No monitor is running -> ShutdownSensor command arrives => clean exit -> StartMonitor command arrives => go to state II. -> Any other command => grumble but keep waiting

  • (II) Monitor is running -> StopMonitor command arrives => stop the mon, dump the report, and go to state I. -> ShutdownSensor command arrives => cancel monitoring, grumble, and exit -> Any other command => grumble but keep waiting

Jump to

Keyboard shortcuts

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