task

package
v4.6.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionOption

type ExecutionOption func(*executionContext)

func OnFailure

func OnFailure(task Task) ExecutionOption

func OnSuccess

func OnSuccess(task Task) ExecutionOption

func Parallel

func Parallel(tasks ...Task) ExecutionOption

func Sequential

func Sequential(tasks ...Task) ExecutionOption

Sequential runs all tasks sequentially, and returns the first error encountered.Sequential Once a task returns an error, the following tasks will not run.

func SequentialAll

func SequentialAll(tasks ...Task) ExecutionOption

func WithContext

func WithContext(ctx context.Context) ExecutionOption

type MultiError

type MultiError []error

func (MultiError) Error

func (e MultiError) Error() string

type Periodic

type Periodic struct {
	// Interval of the task being run
	Interval time.Duration
	// Execute is the task function
	Execute func() error
	// contains filtered or unexported fields
}

Periodic is a task that runs periodically.

func (*Periodic) Close

func (t *Periodic) Close() error

Close implements common.Closable.

func (*Periodic) Start

func (t *Periodic) Start() error

Start implements common.Runnable.

type Task

type Task func() error

func Close

func Close(v interface{}) Task

func Run

func Run(opts ...ExecutionOption) Task

func Single

func Single(task Task, opts ...ExecutionOption) Task

Jump to

Keyboard shortcuts

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