[go-nuts] GO routine never exits based on stop condition - unable to find the reason

2022-03-28 Thread Gowtham Raj
In this example, we have a *worker*. The idea here is simulate clean shutdown of all go routines based on a condition. In this case, go routines get spun - based on workers count. Each go routine reads the channel, does some work and sends output to the outputChannel. The main go routine

Re: [go-nuts] GO routine never exits based on stop condition - unable to find the reason

2022-03-28 Thread Gowtham Raj
: > There is no guarantee that the select chooses the done case, so you need > to check in work case as well e.g. > https://go.dev/play/p/zAj_qfO4uMA > > On Mon, 28 Mar 2022 at 16:54, Gowtham Raj wrote: > >> In this example, we have a *worker*. The idea here is simulate clean >> shu

Re: [go-nuts] GO routine never exits based on stop condition - unable to find the reason

2022-03-28 Thread Gowtham Raj
Great, thanks! On Mon, 28 Mar 2022 at 12:53, Steven Hartland wrote: > No problem, there's a nice little write up on it stackoverflow > <https://stackoverflow.com/questions/47645808/how-does-select-work-when-multiple-channels-are-involved> > . > > On Mon, 28 Mar 2022 at 17:4