mirror of
https://github.com/grassrootseconomics/cic-chain-events.git
synced 2024-11-22 15:56:45 +01:00
22 lines
309 B
Go
22 lines
309 B
Go
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),
|
|
)
|
|
}
|