Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundedGroup ¶
type BoundedGroup struct {
// contains filtered or unexported fields
}
BoundedGroup wraps an errgroup to be concurrently bounded. The behaviour is the same, the only addition is that the goroutines are not started until they acquire a semaphore.
func NewBoundedGroup ¶
NewBoundedGroup creates a new errgroup that is concurrently bounded by N.
func (*BoundedGroup) Go ¶
func (g *BoundedGroup) Go(f func() error)
Go calls the function f in a new goroutine after acquiring a semaphore. If the goroutine hasn't started yet and the underlying errgroup's context is cancelled, the function f will never be invoked.
func (*BoundedGroup) Wait ¶
func (g *BoundedGroup) Wait() error
Wait blocks until all functions calls from the Go method have returned, then returns the first non-nil error (if any) from them.
Click to show internal directories.
Click to hide internal directories.