pipeline

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipeline added in v0.15.18

type Pipeline[I any] func(*resources) <-chan I

func New

func New[I, O any, S State[I, O]](
	inputs Pipeline[I],
	concurrency int,
	state S,
) Pipeline[O]

New fans input out to concurrency workers. Worth it only when the per-item work outweighs the channel handoff and the goroutine wake-ups it costs: a sequential source feeding cheap writes is faster without it

func Source added in v0.15.18

func Source[I any](it iter.Seq[I]) Pipeline[I]

func (Pipeline[I]) Run added in v0.15.18

func (p Pipeline[I]) Run(ctx context.Context) (<-chan I, func() Result)

type Result added in v0.15.18

type Result struct {
	IsDone bool
	Err    error
}

type State

type State[I, O any] interface {
	Run(index int, input I, outputs chan<- O) error
	Done(index int, outputs chan<- O) error
}

Jump to

Keyboard shortcuts

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