channels

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Merge

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

Merge spawns goroutines aggregating the read data of multiple channels into one. The output channel is closed when all input channels have been closed.

func MergeS

func MergeS[T any](out chan<- T, c []chan T)

MergeS is equivalent to Merge except that it accepts a slice of bidirectional channels, avoiding typing issues that occur when attempting to pass a slice to Merge, while giving up some type safety.

func Split

func Split[T any](in <-chan T, c ...chan<- T)

Split spawns a goroutine copying data from the input channel to one or more output channels. The output channels are closed when the input is closed.

func SplitS

func SplitS[T any](in <-chan T, c []chan T)

SplitS is equivalent to Split except that it accepts a slice of bidirectional channels, avoiding typing issues that occur when attempting to pass a slice to Split, while giving up some type safety.

Types

This section is empty.

Jump to

Keyboard shortcuts

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