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.
Also: When you receive from a *closed buffered channel*, you first receive
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).


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.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 9 of 9 | next ›
Discussion Overview
groupgolang-nuts @
postedNov 17, '14 at 9:04p
activeNov 18, '14 at 11:04p



site design / logo © 2021 Grokbase