task

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

A task encapsulates the logic of iterating or using composites for either a job or a workflow.

Index

Constants

This section is empty.

Variables

View Source
var ErrDisconnectedNode = errors.New("node expected by input doesn't exist")
View Source
var ErrEmptyWorkflows = errors.New("no workflows provided")
View Source
var ErrExecutorNotFound = errors.New("executor type not found")
View Source
var ErrJobNotFound = errors.New("job not found")
View Source
var ErrNoRootNodes = errors.New("no root nodes found, please check your config")
View Source
var ErrTooManyRootNodes = errors.New("too many root nodes found, amplify only works with one root node")

TODO: This is a limitation. No reason why we can't have multiple root nodes.

View Source
var ErrWorkflowNoJobs = errors.New("workflow has no jobs")
View Source
var ErrWorkflowNotFound = errors.New("workflow not found")

Functions

This section is empty.

Types

type TaskFactory

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

func NewTaskFactory

func NewTaskFactory(appContext cli.AppContext, execQueue queue.Queue) (*TaskFactory, error)

NewTaskFactory creates a factory that makes it easier to create tasks for the workers

func (*TaskFactory) CreateTask

func (f *TaskFactory) CreateTask(ctx context.Context, workflowFilter string, cid string) (*dag.Node[dag.IOSpec], error)

Create tasks forms the DAG of all the work. The number of inputs (len(cid)) must be equal to the number of outputs (len(dag.Nodes)), otherwise it ends up running multiple times.

func (*TaskFactory) GetJob

func (f *TaskFactory) GetJob(name string) (config.Job, error)

GetJob gets a job config from a job factory

func (*TaskFactory) GetNode

func (f *TaskFactory) GetNode(step string) (config.Node, error)

func (*TaskFactory) JobNames

func (f *TaskFactory) JobNames() []string

JobNames returns all the names of the jobs in a job factory

func (*TaskFactory) NodeNames

func (f *TaskFactory) NodeNames() []string

Jump to

Keyboard shortcuts

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