Re:Creating a Proxy Server with Go
by mcot2 on Sunday September 22, 2013 @09:51AM
(#6426664)
Looking at this some more... Why wouldn't you just make the waiting chan buffered and eliminate any tracking of connections.
[ Parent
| on HN ]
Re:Creating a Proxy Server with Go
by jokeofweek on Sunday September 22, 2013 @10:03AM
(#6426692)
Hey, poster here.
You're right that sync/atomic could've taken care of this, I wasn't aware of that package and figured channels were the way to go in Go.
As for making the waiting chan buffered, the reason I wanted to keep track of pending connections and active connections is because I'd like to proxy from a high-power server to a low-power server such as a Raspberry Pi. I agree with you that it could have done without though.
Thanks for the tips! :-)
So perhaps I was a bit harsh. Do check out this set of slides though: http://talks.golang.org/2012/concurrency.slide
One of the last slides: http://talks.golang.org/2012/concurrency.slide#54
Re:Creating a Proxy Server with Go
by jokeofweek on Sunday September 22, 2013 @11:13AM
(#6426840)
Thanks, that's an awesome resource!