parahelpers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT 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[T any] interface {
	Enqueue(T) error
	Wait() error
}

Group is a group of workers that can be used to enqueue work and wait for them to finish.

func RunGroup

func RunGroup[T any](ctx context.Context, cfg GroupConfig[T]) Group[T]

RunGroup creates a new Group with the given configuration.

type GroupConfig

type GroupConfig[T any] struct {
	NumWorkers int
	Handle     func(context.Context, T) error
}

GroupConfig is the configuration for a new Group.

Jump to

Keyboard shortcuts

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