channels

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drain added in v0.1.0

func Drain[T any](in <-chan T, fn func(in T))

Drain receives each value from an input channel and does something with it.

func Generate

func Generate[T any](values ...T) <-chan T

Generate sends each value to the out channel.

func Merge

func Merge[T any](in ...<-chan T) (out chan T)

Merge sends each value from a list of input channels to the out channel.

func Multiplex added in v0.1.16

func Multiplex[T any](in <-chan T, num int) (out []chan T)

Multiplex sends each value from an input channel to every output channel.

func Process

func Process[T any](in <-chan T, fn func(in T) T) chan T

Process works on each value from an input channel and sends the result to an output channel.

func Split added in v0.1.16

func Split[T any](in <-chan T, num int) (out []chan T)

Split sends each value from an input channel to one of the output channels.

Types

This section is empty.

Jump to

Keyboard shortcuts

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