dependency_manager

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegularNodeStates = []NodeState{NodeStateCreated}

Functions

This section is empty.

Types

type DependencyManager

type DependencyManager interface {
	// AddNode adds a node to the dependency manager.
	AddNode(name string)
	// AddDependency adds a dependency between depender and dependee.
	// The depender will effectively wait for the dependee to finish.
	AddDependency(dependee, depender string) error
	// WaitForNodeDependencies is called by a node that is meant to be created.
	// This call will bock until all the nodes that this node depends on are created.
	WaitForNodeDependencies(nodeName string) error
	// SignalDone is called by a node that has finished all tasks for the provided State.
	// internally the dependent nodes will be "notified" that an additional (if multiple exist) dependency is satisfied.
	SignalDone(nodeName string, state NodeState)
	// CheckAcyclicity checks if dependencies contain cycles.
	CheckAcyclicity() error
	// String returns a string representation of dependencies recorded with dependency manager.
	String() string
	// WaitForNodes blocks until all the nodes in the provided list have reached the provided state.
	WaitForNodes(nodeNames []string, status NodeState) error
}

func NewDependencyManager

func NewDependencyManager() DependencyManager

NewDependencyManager constructor.

type NodeState

type NodeState int
const (
	NodeStateCreated NodeState = iota
)

Jump to

Keyboard shortcuts

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