Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
Graph represents the graph data structure
func NewGraph ¶
func NewGraph() *Graph
NewGraph creates a new instance of the graph and returns a pointer to it
func (*Graph) AddEdge ¶
AddEdge adds edge from source to destination nodes
These edges are unidirectional, hence for bidirectional edges this method needs to be called twice
func (*Graph) DetectCycle ¶
DetectCycle will return true if there is a cycle in the graph
type ParallelProcessGraph ¶
type ParallelProcessGraph struct { Edges map[string][]string ParallelProcessGraphNodeMap map[string]*ParallelProcessGraphNode // contains filtered or unexported fields }
ParallelProcessGraph provides methods for parallel processing of the graph
func NewParallelProcessGraph ¶
func NewParallelProcessGraph(g *Graph) *ParallelProcessGraph
NewParallelProcessGraph creates a parallel processing graph from a simple graph returns a pointer to ParallelProcessGraph
func (*ParallelProcessGraph) Traverse ¶
func (g *ParallelProcessGraph) Traverse(fn VisitFn)
Traverse spins up the processes concurrently if it can
type ParallelProcessGraphNode ¶
type ParallelProcessGraphNode struct { Name string Data *Node DepUpdateCh chan struct{} DepCancleCh chan struct{} DepCount int // contains filtered or unexported fields }
ParallelProcessGraphNode is the node for ParallelProcessGraph it contains the constructs for channel based communication
func (*ParallelProcessGraphNode) Process ¶
func (v *ParallelProcessGraphNode) Process(deps []*ParallelProcessGraphNode, wg *sync.WaitGroup, fn VisitFn)
Process starts an internal loop which listens for the signals on the channels and operate accordingly
type Plan ¶
Plan struct represents a node of an execution plan
func CreatePlan ¶
CreatePlan takes in the application components and creates a plan of execution for it
func (*Plan) Execute ¶
Execute traverses the plan and calls the callback function on each of the node
func (*Plan) IsFeasible ¶
IsFeasible returns true if the plan execution is feasible