Documentation ¶
Index ¶
- func Batch[D, T any](done <-chan D, in <-chan T, maxItems int, maxTimeout time.Duration) <-chan []T
- func Demux[D, T any](done <-chan D, in <-chan T, size int) []<-chan T
- func Filter[D, T any](done <-chan D, in <-chan T, fn func(T) bool) <-chan T
- func FormatJson[D, T any](done <-chan D, in <-chan T) <-chan string
- func Map[D, T, U any](done <-chan D, in <-chan T, fn func(T) U) <-chan U
- func Mux[D any](done <-chan D, channels ...<-chan any) <-chan any
- func OrDone[D, T any](done <-chan D, in <-chan T) <-chan T
- func Tee[D, T any](done <-chan D, in <-chan T, outputs ...chan T)
- func TeeFixed[D, T any](done <-chan D, in <-chan T, size int) []<-chan T
- func ToAny[D, T any](done <-chan D, in <-chan T) <-chan any
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Demux ¶
Demux distributes the stream of data from a single channel across multiple channels to parallelize CPU use and I/O
func FormatJson ¶
func OrDone ¶
func OrDone[D, T any](done <-chan D, in <-chan T) <-chan T
OrDone provides an explicit cancellation mechanism to ensure the encapsulated and downstream goroutines are cleaned up. This frees the caller from depending on the input channel to close in order to free the goroutine, thus preventing possible leaks.
Types ¶
Click to show internal directories.
Click to hide internal directories.