diff --git a/utils.go b/utils.go index 43a3baa..8873523 100644 --- a/utils.go +++ b/utils.go @@ -1,10 +1,5 @@ package channel -import ( - "context" - "time" -) - func determineBufferSize[T any](channels []<-chan T) int { if len(channels) == 0 { return 0 @@ -16,3 +11,9 @@ func determineBufferSize[T any](channels []<-chan T) int { } return bufSize / len(channels) } + +// Flush consumes all values and discards them immediately +func Flush[T any](sources ...<-chan T) { + for range Merge(sources...) { + } +}