parallel

package
v3.9.1-2869 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkDir

func WalkDir[T any](ctx context.Context, fsys fs.FS, root string, parallel int,
	onFile onFile[T], onResult onWalkResult[T]) error

Types

type Pipeline

type Pipeline[T, U any] struct {
	// contains filtered or unexported fields
}

Pipeline represents a structure for performing parallel processing. T represents the input element type and U represents the output element type.

func NewPipeline

func NewPipeline[T, U any](numWorkers int, progress bool, items []T,
	fn1 onItem[T, U], fn2 onResult[U]) Pipeline[T, U]

func (*Pipeline[T, U]) Do

func (p *Pipeline[T, U]) Do(ctx context.Context) error

Do executes pipeline processing. It exits when any error occurs.

Jump to

Keyboard shortcuts

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