Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Batch ¶ added in v0.314.0
func Batch[T any](ch chan T, opts ...BatchOption) chan []T
func Merge ¶
func Merge[T any, Chan chan T | <-chan T](chans ...Chan) (_ <-chan T, cancel func())
Merge will join channels into a single one channel. If any of the channels receive a value, it will surface from out.
Example ¶
package main
import (
"go.llib.dev/frameless/pkg/chankit"
)
func main() {
var (
ch1 = make(chan int)
ch2 = make(chan int)
ch3 = make(chan int)
)
out, cancel := chankit.Merge(ch1, ch2, ch3)
defer cancel()
// out will receive values from ch1, ch2, ch3
<-out
}
Types ¶
type BatchConfig ¶ added in v0.314.0
func (BatchConfig) Configure ¶ added in v0.314.0
func (c BatchConfig) Configure(t *BatchConfig)
type BatchOption ¶ added in v0.314.0
type BatchOption option.Option[BatchConfig]
Click to show internal directories.
Click to hide internal directories.