pl

package
v0.0.0-...-9a0c461 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package pl implements some Data Pipeline helper functions. Reference: https://medium.com/amboss/applying-modern-go-concurrency-patterns-to-data-pipelines-b3b5327908d4#3a80

See also:

https://www.oreilly.com/library/view/concurrency-in-go/9781491941294/ch04.html#fano_fani
https://www.youtube.com/watch?v=f6kdp27TYZs
https://www.youtube.com/watch?v=QDDwwePbDtw

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSlice

func FromSlice[T any](ctx context.Context, in []T) <-chan T

func Merge

func Merge[T any](ctx context.Context, cs ...<-chan T) <-chan T

func ReadOrDone

func ReadOrDone[T any](ctx context.Context, in <-chan T) <-chan T

func SendOrDone

func SendOrDone[T any](ctx context.Context, out chan<- T, v T)

func Sink

func Sink[In any](
	ctx context.Context,
	maxWorkers int,
	inputChannel <-chan In,
	fn func(context.Context, In) error,
) chan error

func Stage

func Stage[In any, Out any](
	ctx context.Context,
	maxWorkers int,
	inputChannel <-chan In,
	fn func(context.Context, In) (Out, error),
) (chan Out, chan error)

func Tee

func Tee[T any](ctx context.Context, in <-chan T) (<-chan T, <-chan T)

Types

This section is empty.

Jump to

Keyboard shortcuts

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