waitgroupx

package
v0.38.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 3

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 sync.WaitGroup that associates a cancelable context with it.

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()

Close the group by canceling it and waiting for it.

func (*Group) Go

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

Go launch the given function in a goroutine as a member of the group.

func (*Group) Wait

func (g *Group) Wait()

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