managed

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeatData

type BeatData struct {
	Range  pulse.Range
	Online census.OnlinePopulation
}

type Component

type Component interface {
	// Init is called when a component is added to a conveyor.
	// NB! When calls to Start() or Stop() may happen concurrently with Init() when the component is added in a separate goroutine.
	Init(Holder)
	// Start is called on component when Conveyor's worker is started, or when a component is added to a started conveyor
	// NB! When conveyor is already started, call to Stop() may happen before completion of Start()
	Start(Holder)
	Stop(Holder)
}

Component is a component managed on conveyor's level. It has access to conveyor's internal SlotMachine, but not to individual pulse slots.

type ComponentWithPulse

type ComponentWithPulse interface {
	Component
	// PulseMigration is called during pulse migration procedure of the conveyor.
	// It is invoked after all internal operations of the conveyor, but before migration of pulse slots.
	// MUST NOT perform heavy operations as the whole conveyor is blocked.
	PulseMigration(Holder, pulse.Range)
}

ComponentWithPulse enables a component to be notified during pulse migration.

type DataManager

type DataManager interface {
	GetPresentPulse() (present pulse.Number, nearestFuture pulse.Number)
	GetPrevBeatData() (pulse.Number, BeatData)
	GetBeatData(pn pulse.Number) BeatData
	HasPulseData(pn pulse.Number) bool
	TouchPulseData(pn pulse.Number) bool
}

type Holder

type Holder interface {
	GetDataManager() DataManager
	AddManagedComponent(Component)
	AddInputExt(pn pulse.Number, event interface{}, createDefaults smachine.CreateDefaultValues) error
	WakeUpWorker()

	injector.DependencyContainer
	AddDependency(v interface{})
	AddInterfaceDependency(v interface{})

	GetPublishedGlobalAliasAndBargeIn(key interface{}) (smachine.SlotLink, smachine.BargeInHolder)
}

type RegisterComponentFunc

type RegisterComponentFunc = func(Component)

Jump to

Keyboard shortcuts

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