Skip to content

go-laeo/chanbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chanbus

build.yaml Go Reference golangci.yaml

Package chanbus is a 1:n channel broadcasting for golang.

Install

go get github.com/go-laeo/chanbus

Example

// First 0 means no buffer of main channel, and second
// 0 means blocking on forwarding to derived channels.
ch := chanbus.New(1, 0)

// Send value to main channel.
ch.Send("say, hi")

// Derives new readonly channel
nch := ch.Derive(1)

for v := range nch {
    fmt.Println(v) // say, hi
}

License

The MIT license.

About

1:N channel broadcasting for golang.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages