runner

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package runner implements a directed acyclic graph task runner with deterministic teardown. it is similar to package errgroup, in that it runs multiple tasks in parallel and returns the first error it encounters. Users define a Runner as a set vertices (functions) and edges between them. During Run, the directed acyclec graph will be validated and each vertex will run in parallel as soon as it's dependencies have been resolved. The Runner will only return after all running goroutines have stopped.

Index

Constants

View Source
const (
	LIVELOG = 5000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Config config.Config
}

func DefaultConfig

func DefaultConfig() *Config

type Line added in v1.15.0

type Line struct {
	Pos     int64
	Time    int64
	Message string
}

type Livelog added in v1.15.0

type Livelog struct {
	Error chan error
	Line  chan *Line
}

type Runner

type Runner interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context, string, []string, context.CancelFunc) error
	Tail(ctx context.Context) Livelog
}

func New

func New(_ context.Context, cfg *Config) Runner

Jump to

Keyboard shortcuts

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