tree

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Unlicense Imports: 4 Imported by: 6

README

go-tree

  • gc loops launched on close to monitor agent and children
  • short lived gc loops should be easy to spot if accumulating

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Warn    func(args ...interface{})
	Recover func(ss string, args ...interface{})
}

type Node

type Node interface {
	Name() string
	State() *State
	AddChild(name string) Node
	GetValue(name string) interface{}
	SetValue(name string, value interface{})
	AddProcess(name string, action func())
	AddAction(name string, action func())
	AddCloser(name string, closer func() error)
	AddChannel(name string, channel chan interface{})
	Disposed() <-chan interface{}
	Closed() <-chan interface{}
	WaitDisposed()
	WaitClosed()
	Recover()
	Close()
}

func NewRoot

func NewRoot(name string, log *Log) Node

type Reversed

type Reversed interface {
	Count() int
	Names() []string
	Values() []interface{}
	Get(string) interface{}
	Set(string, interface{})
	Remove(string) interface{}
}

func NewReversed

func NewReversed() Reversed

type State

type State struct {
	Name     string
	Values   map[string]string
	Actions  []string
	Agents   []string
	Children []Node
	Closed   bool
	Disposed bool
}

Jump to

Keyboard shortcuts

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