cic-chain-events/internal/pool/pool.go

22 lines
309 B
Go
Raw Normal View History

2023-01-05 12:45:09 +01:00
package pool
import (
"time"
"github.com/alitto/pond"
)
type Opts struct {
ConcurrencyFactor int
PoolQueueSize int
}
func NewPool(o Opts) *pond.WorkerPool {
return pond.New(
o.ConcurrencyFactor,
o.PoolQueueSize,
pond.MinWorkers(o.ConcurrencyFactor),
pond.IdleTimeout(time.Second*1),
)
}