On Tuesday, November 18, 2014 6:39:27 PM UTC+2, Philip Thomas wrote:
I guess the main problem I am having is coordinating the shutdown of
multiple what I would call "queue workers" - basically one input channel,
one output channel, and about 1000 goroutines processing input, dropping
some data, and sending on the output channel. What's the standard pattern
for recognizing that the input channel has closed, then closing the output
channel when processing has finished without losing data (e.g. "ERROR -
output channel already closed"). I thought that the input shutdown message
could only be received by one queue worker, not all of them.
I guess the main problem I am having is coordinating the shutdown of
multiple what I would call "queue workers" - basically one input channel,
one output channel, and about 1000 goroutines processing input, dropping
some data, and sending on the output channel. What's the standard pattern
for recognizing that the input channel has closed, then closing the output
channel when processing has finished without losing data (e.g. "ERROR -
output channel already closed"). I thought that the input shutdown message
could only be received by one queue worker, not all of them.
all the data in the buffer normally (as if the channel had not been closed) *and
then* you receive the channel-closed indication (the zero-value or the ok
== false).
/npat
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.