gopool
is a high-performance goroutine pool which aims to reuse goroutines and limit the number of goroutines.
It is an alternative to the go
keyword.
- High Performance
- Auto-recovering Panics
- Limit Goroutine Numbers
- Reuse Goroutine Stack
go get -u github.com/bytepowered/goes
Just replace your go func(){...}
with goes.Go(func(){...})
.
old:
go func() {
// do your job
}()
new:
goes.Go(func(){
/// do your job
})