Thanks!

Seems to be the best solution. I just wanted to check what should be done; 
in such situations which that extra signaling about closing channel is 
undesirable.

Actually since there is a timeout element too, here a method is used (func 
(p *Payload) WaitResult(timeout ...time.Duration) (*Result, error) {...}). 
And an explicit ErrTimeout is preferred here, instead of overloading the 
semantic of closing channel, with the concept of timeout. But since there 
can not be any other sort of errors (the Result has an error field itself) 
I wonder if I should use that.

On Monday, October 30, 2017 at 12:40:07 PM UTC+3:30, Dave Cheney wrote:
>
> I think you should use a channel. If the communication is between two 
> parities then there is no need to close the channel after sending the 
> result as the are not other parties to inform that they missed the message. 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to