runner

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrInterrupt

func IsErrInterrupt(err error) bool

func IsErrTimeout

func IsErrTimeout(err error) bool

Types

type ErrType

type ErrType int
const (
	ErrTypeNormal ErrType = iota
	ErrTypeTimeout
	ErrTypeInterrupt
)

func (ErrType) String

func (errType ErrType) String() string

type Error

type Error struct {
	Type ErrType
	Name string
}

func (*Error) Error

func (e *Error) Error() string

type Job

type Job struct {
	Name string
	Task Task
}

type Runner

type Runner struct {
	Name string
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(ctx context.Context, name string, numWorkers int) *Runner

func (*Runner) Add

func (r *Runner) Add(task Task, desc ...string)

func (*Runner) Commit

func (r *Runner) Commit() (err error)

type Task

type Task func(ctx context.Context) error

Jump to

Keyboard shortcuts

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