Documentation ¶
Index ¶
- type DependencyManager
- type DependencyNode
- func (d *DependencyNode) AddDepender(dependerStage types.WaitForStage, depender *DependencyNode, ...) error
- func (d *DependencyNode) Done(ctx context.Context, p types.WaitForStage)
- func (d *DependencyNode) EnterStage(ctx context.Context, p types.WaitForStage)
- func (d *DependencyNode) MustWait(state types.WaitForStage) bool
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
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
func (d *DependencyNode) Done(ctx context.Context, p types.WaitForStage)
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.