4 ms·
Typically if you wish to limit the number of goroutines you would spawn N workers and have them read from a single channel. If 20k of your incoming connections
by Jabbles 11y ago
Typically if you wish to limit the number of goroutines you would spawn N workers and have them read from a single channel. If 20k of your incoming connections want to do something they send on the channel, without spawning a goroutine themselves.
Did you try something like that?
- windlep 11y agoYep, this is what I meant by 'goroutine pools'. The select statements were on the sending side to ensure if the feed channel was full we wouldn't retain too much additional state. It works, but at that point its starting to look like an async event-loop with a thread-pool....
- zimbatm 11y agoHow do these 20k connection feed the channel without being themselves managed by goroutines ? One thing I wish was possible in go is being able to use the `select` keyword with both channels and IO.