Make pool's queue buffered. Workaround while we don't put the queue in disk
This commit is contained in:
parent
464e251d19
commit
1e57852eff
1 changed files with 4 additions and 1 deletions
|
|
@ -13,12 +13,15 @@ type Pool struct {
|
||||||
//queue *dque.DQue
|
//queue *dque.DQue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO This hardcoded value will go away when the queue is persisted in disk
|
||||||
|
const bufferSize = 10000
|
||||||
|
|
||||||
func NewPool(name string, workerCount int, item interface{}, exec Executor) (*Pool, error) {
|
func NewPool(name string, workerCount int, item interface{}, exec Executor) (*Pool, error) {
|
||||||
p := &Pool{
|
p := &Pool{
|
||||||
name: name,
|
name: name,
|
||||||
item: item,
|
item: item,
|
||||||
exec: exec,
|
exec: exec,
|
||||||
queue: make(chan work),
|
queue: make(chan work, bufferSize),
|
||||||
end: make(chan bool),
|
end: make(chan bool),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue