# README
gopool
Introduction
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.
Features
- High Performance
- Auto-recovering Panics
- Limit Goroutine Numbers
- Reuse Goroutine Stack
QuickStart
Just replace your go func(){...}
with gopool.Go(func(){...})
.
old:
go func() {
// do your job
}()
new:
gopool.Go(func(){
/// do your job
})
# Functions
CtxGo is preferred than Go.
GetPool gets the registered pool by name.
Go is an alternative to the go keyword, which is able to recover panic.
NewConfig creates a default Config.
NewPool creates a new pool with the given name, cap and config.
RegisterPool registers a new pool to the global map.
SetCap is not recommended to be called, this func changes the global pool's capacity which will affect other callers.
SetPanicHandler sets the panic handler for the global pool.
WorkerCount returns the number of global default pool's running workers.
# Interfaces
No description provided by the author