dependency_manager

package
v0.51.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: BSD-3-Clause Imports: 6 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(name string)
	// GetNode gets a dependency node registered with the dependency manager.
	GetNode(name string) (*DependencyNode, error)
	// AddDependency adds a dependency between a depender and and a dependee.
	// The depender will hold off the dependerStage until the dependee completes dependeeStage.
	// This effectively makes the dependerStage to be start only after the dependeeStage finishes.
	AddDependency(depender string, dependerStage types.WaitForStage, dependee string, dependeeStage types.WaitForStage) error
	// CheckAcyclicity checks if dependencies contain cycles.
	CheckAcyclicity() error
	// String returns a string representation of dependencies recorded with dependency manager.
	String() string
}

func NewDependencyManager

func NewDependencyManager() DependencyManager

NewDependencyManager constructor.

type DependencyNode added in v0.51.0

type DependencyNode struct {
	// contains filtered or unexported fields
}

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

func (*DependencyNode) Done added in v0.51.0

func (d *DependencyNode) Done(p types.WaitForStage)

SignalDone 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(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