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 Send[D, T any](done <-chan D, tgt chan<- T, val T) bool
- func SendAny[T any](done <-chan T, tgt chan<- any, val any) bool
- 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.
func Send ¶ added in v2.1.6
Send sends a value to a channel while monitoring the done channel for cancellation
func SendAny ¶ added in v2.1.6
SendAny sends a value to an any channel while monitoring the done channel for cancellation
Types ¶
Click to show internal directories.
Click to hide internal directories.