ivpusic / grpool

Lightweight Goroutine pool

Home Page:https://godoc.org/github.com/ivpusic/grpool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why do you insert data into the channel and take it out immediately? What's the effect?

1325075688gw opened this issue · comments

worker.stop <- struct{}{}

wait worker stop task(Maybe it's a time-consuming stop) like

                            case <-w.stop:
                                // do somethine
				w.stop <- struct{}{}
				return

The previous sending and receiving operation is to transmit the signal to start the stop, and the following sending and receiving operation is to complete the execution.