Skip to content
/ chirp Public

A simple module for concurrent safe fan out delivery to io.Writers

License

Notifications You must be signed in to change notification settings

dubbled/chirp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chirp

Is a simple module for concurrent safe fan out delivery to io.Writers

Usage

nest := NewNest(nil) // nil supplies Nest with default settings
topic := "testing"
go func() {
    tick := time.Tick(time.Second)
    for {
        <-tick
        err := nest.MsgSubscribers(topic, []byte("tick"))
    }
}()

l, err := net.Listen("tcp", ":8080")
for {
    conn, err := l.Accept()
    client := &Client{}
    client.SetWriter(w)
    err := nest.InsertClient(topic, client)
    err := client.Write([]byte("connected to hub!"))
}

Contributing

Pull requests are welcome.

About

A simple module for concurrent safe fan out delivery to io.Writers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages