Hi,

So I have the following:
https://play.golang.org/p/dcuhh40DFZ

Yet I believe it exposes the following issues:
1. If sendWork is at line 54, it's possible that doWrites will hit line 79, 
falsely reporting a timeout case due to timing issues. Correct?
2. In case of a real timeout (where the write to io.Writer blocks for 
longer than a timeout), it seems there is no way not to leak an open 
channel. I can't close the channel after a timeout as it'd panic on line 78 
due to write to a closed channel, or close the channel in the case of 
discard, but I'd have to solve #1 to be able to do that.

I am looking for advice how this could be implemented in a more robust way 
without leaking resources.

Thank you.

-- 
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