dependency_manager

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyManager

type DependencyManager interface {
	// AddNode adds a node to the dependency manager.
	AddNode(node clabnodes.Node)
	// GetNode gets a dependency node registered with the dependency manager.
	GetNode(name string) (*DependencyNode, error)
	// CheckAcyclicity checks if dependencies contain cycles.
	CheckAcyclicity() error
	// String returns a string representation of dependencies recorded with dependency manager.
	String() string
	// GetNodes returns the DependencyNodes registered with the DependencyManager
	GetNodes() map[string]*DependencyNode
}

func NewDependencyManager

func NewDependencyManager() DependencyManager

NewDependencyManager constructor.

type DependencyNode

type DependencyNode struct {
	clabnodes.Node
	// contains filtered or unexported fields
}

DependencyNode is the representation of a node in the dependency concept.

func NewDependencyNode

func NewDependencyNode(node clabnodes.Node) *DependencyNode

NewDependencyNode initializes a dependencyNode with the given name.

func (*DependencyNode) AddDepender

func (d *DependencyNode) AddDepender(dependerStage clabtypes.WaitForStage,
	depender *DependencyNode, stage clabtypes.WaitForStage,
) error

AddDepender adds a depender to the dependencyNode. This will also add the dependee to the depender to increase the waitgroup count for the depender.

func (*DependencyNode) Done

Done is called by a node that has finished all tasks for the provided stage. The dependent nodes will be "notified" that an additional (if multiple exist) dependency is satisfied.

func (*DependencyNode) EnterStage

func (d *DependencyNode) EnterStage(ctx context.Context, p clabtypes.WaitForStage)

EnterStage is called by a node that is meant to enter the specified stage. The call will be blocked until all dependencies for the node to enter the stage are met, or until the context is cancelled (e.g. on a Ctrl-C), in which case it returns without running the stage execs so the worker can unwind instead of hanging until SIGQUIT.

func (*DependencyNode) MustWait

func (d *DependencyNode) MustWait(state clabtypes.WaitForStage) bool

MustWait returns true if the node needs to wait for the given stage, because dependers do exist.

Jump to

Keyboard shortcuts

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