dependency_manager

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: BSD-3-Clause Imports: 9 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 nodes.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 added in v0.51.0

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

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

func NewDependencyNode added in v0.52.0

func NewDependencyNode(node nodes.Node) *DependencyNode

newDependencyNode initializes a dependencyNode with the given name.

func (*DependencyNode) AddDepender added in v0.52.0

func (d *DependencyNode) AddDepender(dependerStage types.WaitForStage, depender *DependencyNode, stage types.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 added in v0.51.0

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 added in v0.51.0

func (d *DependencyNode) EnterStage(ctx context.Context, p types.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.

func (*DependencyNode) MustWait added in v0.51.0

func (d *DependencyNode) MustWait(state types.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