2 ms·
It's isomorphic and better, because each goroutine performs a synchronous and easily understood acquire-perform-sleep looping operation with no hairy coordinati
by JulianMorrison 13y ago
It's isomorphic and better, because each goroutine performs a synchronous and easily understood acquire-perform-sleep looping operation with no hairy coordination. And even underneath, it's somewhat simpler, because neither Go nor the design I gave cares which of the runnable goroutines (the servers that have finished their work) takes the next request off the channel. Plus the blocking behaviour of channels gives you implicit backpressure if the requests are coming in too fast - the process putting them on the channel will stall.
- cookingrobot 13y agoYou probably should care which server gets the request. It's not explicitly said, but if one server can handle twice as many requests per second, then it might be completing each request faster. If that's the case, it's a better service to give more requests to the faster servers. Worth at least discussing to see if there are other aspects to the problem.