supervisor

package
v0.0.0-...-ff01800 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	Supervisor *Supervisor
	Name       string
	// contains filtered or unexported fields
}

func (*Entity) GetCore

func (ent *Entity) GetCore() EntityCore

func (*Entity) GetQuantCount

func (ent *Entity) GetQuantCount() int64

for calls from within entity core. For testing/debugging

type EntityCore

type EntityCore interface {
	Call(Trits, Trits) bool
}

type EnvironmentInfo

type EnvironmentInfo struct {
	JoinedEntities []string
	AffectedBy     []string
}

type Supervisor

type Supervisor struct {
	Name string
	// contains filtered or unexported fields
}

func NewSupervisor

func NewSupervisor(name string, lockTimeout time.Duration) *Supervisor

func (*Supervisor) Affect

func (sv *Supervisor) Affect(envName string, entity *Entity, delay int) error

func (*Supervisor) Attach

func (sv *Supervisor) Attach(entity *Entity, joins, affects map[string]int) error

func (*Supervisor) ClearEnvironments

func (sv *Supervisor) ClearEnvironments() error

func (*Supervisor) CreateEnvironment

func (sv *Supervisor) CreateEnvironment(name string) error

func (*Supervisor) DeleteEnvironment

func (sv *Supervisor) DeleteEnvironment(envName string) error

func (*Supervisor) DoIfIdle

func (sv *Supervisor) DoIfIdle(timeout time.Duration, doFunc func()) bool

func (*Supervisor) DoOnIdle

func (sv *Supervisor) DoOnIdle(doFunc func())

loops until Supervisor becomes idle and calls doFunc

func (*Supervisor) EnvironmentInfo

func (sv *Supervisor) EnvironmentInfo() map[string]*EnvironmentInfo

func (*Supervisor) GetQuantCount

func (sv *Supervisor) GetQuantCount() int64

func (*Supervisor) Join

func (sv *Supervisor) Join(envName string, entity *Entity, limit int) error

func (*Supervisor) NewEntity

func (sv *Supervisor) NewEntity(name string, inSize, outSize int, core EntityCore) (*Entity, error)

func (*Supervisor) PostEffect

func (sv *Supervisor) PostEffect(envName string, effect Trits, delay int) error

Jump to

Keyboard shortcuts

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