parallel

package
v0.58.0 Latest Latest
Warning

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

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

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 added in v0.39.0

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 added in v0.39.0

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 added in v0.39.0

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