package syncutil

import "github.com/influxdata/flux/internal/pkg/syncutil"

Index

Types

type WaitGroup

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

WaitGroup is a custom sync.WaitGroup that handles functions that return errors.

func (*WaitGroup) Do

func (wg *WaitGroup) Do(fn func() error)

Do starts a new goroutine and executes the function within that goroutine. This will not execute the function if an error has already occurred.

func (*WaitGroup) Wait

func (wg *WaitGroup) Wait() error

Wait waits for all of the goroutines started with Do to finish. It returns the first error encountered, but will wait for the remaining goroutines to finish.

Source Files

wait_group.go

Version
v0.196.1 (latest)
Published
Feb 19, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
1 day ago

Tools for package owners.