Skip to content

Commit 3c1740f

Browse files
authored
Merge pull request #1 from siddhant2408/wp-1
wp-1 removed defer
2 parents a6bce63 + cb2aca0 commit 3c1740f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pool.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ type pool struct {
2020
}
2121

2222
// Delegate job to a workers
23+
// will block if channel is full, you might want to wrap it with goroutine to avoid it
2324
func (p *pool) Delegate(args ...interface{}) {
24-
go func() {
25-
p.queue <- buildQueueValue(args)
26-
}()
25+
p.queue <- buildQueueValue(args)
2726
}
2827

2928
// Start given number of workers that will take jobs from a queue

0 commit comments

Comments
 (0)