parallel

package
v0.5.83 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(tasks []Task, concurrency int64) error

func ExecuteLabeled added in v0.5.82

func ExecuteLabeled(tasks []LabeledTask, concurrency int64, policy ErrorPolicy) error

Types

type ErrorAction added in v0.5.82

type ErrorAction int
const (
	ErrActionIgnore ErrorAction = 0
	ErrActionReport ErrorAction = 1
	ErrActionRetry  ErrorAction = 2
)

type ErrorPolicy added in v0.5.82

type ErrorPolicy func(task LabeledTask, attempt int, err error) ErrorAction

func AlwaysReport added in v0.5.82

func AlwaysReport() ErrorPolicy

type LabeledTask added in v0.5.82

type LabeledTask interface {
	Type() string
	Execute() error
	Label() string
}

func TaskWithLabel added in v0.5.82

func TaskWithLabel(taskType string, label string, task Task) LabeledTask

type Task

type Task func() error

Jump to

Keyboard shortcuts

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