 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
This section is empty.
 Click to show internal directories. 
   Click to hide internal directories.