Can I send param to workpool?
JackTiger opened this issue · comments
directly not, but you can use closures
for i := 0; i < 10; i++ {
count := i
pool.JobQueue <- func() {
fmt.Printf("I am worker! Number %d\n", count)
}
}
Lightweight Goroutine pool
JackTiger opened this issue · comments
directly not, but you can use closures
for i := 0; i < 10; i++ {
count := i
pool.JobQueue <- func() {
fmt.Printf("I am worker! Number %d\n", count)
}
}