concurrency

package
v1.8.1-rc6 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FanIn

func FanIn(done <-chan interface{}, channels ...<-chan interface{}) <-chan interface{}

FanIn multiplexes multiple input channels into a single output channel. It reads from each input channel concurrently until all channels are closed, then closes the output channel. The function takes a 'done' channel to signal cancellation, and variadic 'channels' representing the input channels to multiplex. It returns a single output channel where values from all input channels are sent.

func Take

func Take(done <-chan interface{}, valueStream <-chan interface{}, noOfItemsToTake int) <-chan interface{}

Take reads values from the 'valueStream' input channel and sends them to the output channel 'takeStream'. It reads until 'noOfItemsToTake' items are taken from 'valueStream' or a cancellation signal is received on the 'done' channel. The function returns a channel 'takeStream' where the taken values are sent.

Types

This section is empty.

Jump to

Keyboard shortcuts

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