observer

package
Version: v0.0.0-...-0d16973 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package observer contains interfaces and types for machine node observers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LowerToBuilder

func LowerToBuilder(obs ...Observer) []builder.Observer

LowerToBuilder lowers each observer in obs to a corpus builder observer.

func OnCompileStart

func OnCompileStart(qs quantity.BatchSet, obs ...Observer)

OnCompileStart sends a compile start message to every observer in obs, containing the quantity set qs.

func OnMachineNodeAction

func OnMachineNodeAction(m Message, obs ...Observer)

OnMachineNodeAction distributes m to every observer in obs.

func OnRunStart

func OnRunStart(qs quantity.BatchSet, obs ...Observer)

OnRunStart sends a run start message to every observer in obs, containing the quantity set qs.

Types

type Message

type Message struct {
	// Kind is the kind of message.
	Kind MessageKind
	// Quantities contains, depending on Kind, various pieces of quantity information about the machine node.
	Quantities quantity.MachNodeSet
}

Message is the type of messages from a machine node observer.

type MessageKind

type MessageKind uint8

MessageKind is the enumeration of possible messages from a machine node observer.

const (
	// KindCompileStart means that the machine node is starting its compile phase.
	// Quantities.Compile contains the compiler quantities.
	KindCompileStart MessageKind = iota
	// KindRunStart means that the machine node is starting its run phase.
	// Quantities.Run contains the runner quantities.
	KindRunStart
)

type Observer

type Observer interface {
	// Observer allows observing the corpus builds for both compilation and running.
	builder.Observer

	// OnMachineNodeAction observes a machine node action, usually forwarded from a remote node.
	OnMachineNodeAction(Message)
}

Observer is the interface of anything that observes machine node behaviour.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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