channels

package module
v0.1.0-dev.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 4 Imported by: 0

README

channels Go Reference

channel utilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyElements

func ApplyElements[T1, T2 any](n uint16, in []T1, f func(T1) T2) []T2

func CountReceived

func CountReceived[T any](in <-chan T) int

func Drain

func Drain[T any](c <-chan T)

func FanIn

func FanIn[T any](channels ...<-chan T) <-chan T

func FanOut

func FanOut[T any](n uint16, in <-chan T) []<-chan T

func ReceiveElements

func ReceiveElements[T any](c <-chan T) []T

func SendElements

func SendElements[T any](in []T) <-chan T

func Workers

func Workers[T1, T2 any](n uint16, in <-chan T1, f func(T1) (T2, bool)) <-chan T2

Workers creates a channel that receives the output of f applied to each element of in. When f returns false, the result is not sent on the channel.

Types

This section is empty.

Jump to

Keyboard shortcuts

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