errgroup

package
v4.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: AGPL-3.0 Imports: 5 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 NewGroupWithContext

func NewGroupWithContext(ctx context.Context, limit int, retryOpts ...retry.Option) (*Group, context.Context)

func NewOrderedGroupWithContext added in v4.3.4

func NewOrderedGroupWithContext(ctx context.Context, limit int, retryOpts ...retry.Option) (*Group, context.Context)

OrderedGroup

func (*Group) Err

func (g *Group) Err() error

func (*Group) Go

func (g *Group) Go(do func(ctx context.Context) error)

func (*Group) GoWithLifecycle added in v4.3.4

func (g *Group) GoWithLifecycle(lifecycle Lifecycle)

func (*Group) SetLimit

func (g *Group) SetLimit(n int) *Group

func (*Group) Success

func (g *Group) Success() uint64

func (*Group) TryGo

func (g *Group) TryGo(f func(ctx context.Context) error) bool

func (*Group) Wait

func (g *Group) Wait() error

type Lifecycle added in v4.3.4

type Lifecycle struct {
	// Before在OrderedGroup是线程安全的
	Before func(ctx context.Context) error
	// 如果Before返回err就不调用Do
	Do func(ctx context.Context) error
	// 最后调用After
	After func(err error)
}

Jump to

Keyboard shortcuts

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