Codebase list golang-gopkg-eapache-go-resiliency.v1 / eadf0b0
Fix goroutine leak in deadline If the deadline timed out then the worker goroutine might have been leaked trying to write to `result` which had no readers. Evan Huus 4 years ago
1 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
3131 stopper := make(chan struct{})
3232
3333 go func() {
34 result <- work(stopper)
34 value := work(stopper)
35 select {
36 case result <- value:
37 case <-stopper:
38 }
3539 }()
3640
3741 select {