Re: [go-nuts] synchronise read from two channels

2016-12-01 Thread omarshariffdontlikeit
Yup I thin I was frying my brain on this - it also led to questions such as "if I read a worker from the channel and there ISNT a URL waiting how do I write back into the channel making it available - what if more than one go routine is reading from the channel... etc" I knew I was over

Re: [go-nuts] synchronise read from two channels

2016-12-01 Thread Jesper Louis Andersen
On Wed, Nov 30, 2016 at 6:07 PM wrote: > Hi, I'm having a bit of a slow day... I'm trying to synchronise two reads > from two channels and can't get my fuzzy head round the problem. > > Go doesn't have support for an (atomic) read from multiple channels at once.

Re: [go-nuts] synchronise read from two channels

2016-11-30 Thread Michael Jones
It seems that you are fighting the helpful infrastructure, but I can’t be sure from what you’ve said. You can (presumably) just do this: For u := range streamOfUrls { For w := range availableWorkers {   w.url = u   activeWorkers <- w } } …but that is strange to me. Why not