errgroupx

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 2 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
}

Group is a thin wrapper around golang.org/x/sync/errgroup.Group that helps not leak its context past the lifetime of the group.

func WithContext

func WithContext(ctx context.Context) Group

WithContext creates a Group as a child of the given context.

func (*Group) Cancel

func (g *Group) Cancel()

Cancel the group, without waiting for it to exit.

func (*Group) Close

func (g *Group) Close() error

Close the group by canceling it and waiting for it.

func (*Group) Go

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

Go launch the given function in a goroutine as a member of the group. If the function returns an error, the Group-scoped context will be canceled.

func (*Group) Wait

func (g *Group) Wait() error

Wait for all child processes of the group to complete.

Jump to

Keyboard shortcuts

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