parallel

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func(ctx context.Context) error

Func is a function declaration used in parallel runs.

type Group

type Group []task

Group is a list of functions to run in parallel.

func (*Group) AddFunc

func (g *Group) AddFunc(name string, f Func)

AddFunc adds a function to the group to later be used in the parallel call. The name is prepended to the error message, if any.

func (*Group) RunCancelEarly

func (g *Group) RunCancelEarly(ctx context.Context) error

RunCancelEarly will run all functions in parallel in separate goroutines, and will cancel them all as soon as one of them returns an error. The resulting error is the error from the first function that errors.

Jump to

Keyboard shortcuts

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