Maintainers: Heptio
Workgroup is a small utility to manage the lifetime of a set of related goroutines.
var g workgroup.Group
g.Add(func(stop <-chan struct{}) error {
l, err := net.Listen("tcp", ":80") // listen on port 80
if err != nil {
return err
}
go func() {
<-stop // close listener on stop request
l.Close()
}()
return http.Serve(l, mux)
})
g.Run()
workgroup.Group
is heavily inspired by prior art including oklog's run.Group
and Gustavo Niemeyer's tomb
packages.
Thanks for taking the time to join our community and start contributing!
Bug reports are most welcome, but with the exception of #5, this project is closed.
- Please familiarize yourself with the Code of Conduct before contributing.
- See CONTRIBUTING.md for information about setting up your environment, the workflow that we expect, and instructions on the developer certificate of origin that we require.
See the list of releases to find out about feature changes.