dag

package
v0.0.0-...-131a0ff Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchedulable

func GetSchedulable(g *Graph, doneTasks ...string) (map[string]struct{}, error)

GetSchedulable returns a map of PipelineTask that can be scheduled (keyed by the name of the PipelineTask) given a list of successfully finished doneTasks. It returns tasks which have all dependecies marked as done, and thus can be scheduled. If the specified doneTasks are invalid (i.e. if it is indicated that a Task is done, but the previous Tasks are not done), an error is returned.

Types

type Graph

type Graph struct {
	//Nodes represent map of PipelineTask name to Node in Pipeline Graph
	Nodes map[string]*Node
}

Graph represents the Pipeline Graph

func Build

func Build(tasks Tasks) (*Graph, error)

Build returns a valid pipeline Graph. Returns error if the pipeline is invalid

type Node

type Node struct {
	// Task represent the PipelineTask in Pipeline
	Task Task
	// Prev represent all the Previous task Nodes for the current Task
	Prev []*Node
	// Next represent all the Next task Nodes for the current Task
	Next []*Node
}

Node represents a Task in a pipeline.

type Task

type Task interface {
	HashKey() string
	Deps() []string
}

type Tasks

type Tasks interface {
	Items() []Task
}

Jump to

Keyboard shortcuts

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