pipeline

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batch

func Batch[D, T any](done <-chan D, in <-chan T, maxItems int, maxTimeout time.Duration) <-chan []T

func Demux

func Demux[D, T any](done <-chan D, in <-chan T, size int) []<-chan T

Demux distributes the stream of data from a single channel across multiple channels to parallelize CPU use and I/O

func Filter added in v1.2.0

func Filter[D, T any](done <-chan D, in <-chan T, fn func(T) bool) <-chan T

func FormatJson

func FormatJson[D, T any](done <-chan D, in <-chan T) <-chan string

func Map added in v1.2.0

func Map[D, T, U any](done <-chan D, in <-chan T, fn func(T) U) <-chan U

func Mux

func Mux[D any](done <-chan D, channels ...<-chan any) <-chan any

Mux joins multiple channels and returns a channel as single stream of data.

func OrDone

func OrDone[D, T any](done <-chan D, in <-chan T) <-chan T

OrDone provides an explicit cancellation mechanism to ensure the encapsulated and downstream goroutines are cleaned up. This frees the caller from depending on the input channel to close in order to free the goroutine, thus preventing possible leaks.

func Tee

func Tee[D, T any](done <-chan D, in <-chan T, outputs ...chan T)

Tee copies the stream of data from a single channel to zero or more channels

func TeeFixed added in v1.2.4

func TeeFixed[D, T any](done <-chan D, in <-chan T, size int) []<-chan T

func ToAny added in v1.2.4

func ToAny[D, T any](done <-chan D, in <-chan T) <-chan any

Types

type Result

type Result[T any] struct {
	Error error
	Ok    T
}

Jump to

Keyboard shortcuts

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