errgroup

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

func WithContext

func WithContext(ctx context.Context) (*Group, context.Context)

func (*Group) Go

func (g *Group) Go(f func() error)

Go calls the given function in a new goroutine. It blocks until the new goroutine can be added without the number of active goroutines in the group exceeding the configured limit.

The first call to return a non-nil error cancels the group's context, if the group was created by calling WithContext. The error will be returned by Wait.

func (*Group) SetLimit

func (g *Group) SetLimit(n int)

func (*Group) TryGo

func (g *Group) TryGo(f func() error) bool

func (*Group) Wait

func (g *Group) Wait() error

Jump to

Keyboard shortcuts

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