to signal when the taks it's done, there's no value to process (that's why
I would use a chan of struct{}).
So when you want to wait for the task to be completed, you do:
<-done
And that blocks until the channel gets closed (when the job is done). And
you get nothing (an empty struct) out of the channel, because there's no
data to process.
(hope I didn't misunderstand your question)
On Wednesday, July 29, 2015 at 9:35:07 PM UTC+2, Justin Israel wrote:
But what if a zero value is a valid channel value to process? A done
channel would mean done.
--But what if a zero value is a valid channel value to process? A done
channel would mean done.
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.