Topo – A library to create in-process topologies of goroutines
github.com
github.com
What you want to do instead, create 1 channel, and make multiple goroutines (Sinks) read from it, then whenever goroutine is finished with the task it would take a new message from that channel.
By picking a channel to dispatch yourself you don't take into account busy-ness of it, so you might wait on a channel even though there are others that are idling waiting for messages to be accepted.
https://github.com/eapache/channels
Unfortunately Go's lack of generics hurts in letting me use these helpers in a way that guarantees the data types going in/out of the generic channels.
(This is my biggest complaint about Go. It's too easy to accidentally share data between goroutines, because so many things are implicitly references to mutable objects. Slices, for example, are references. Erlang and Rust, which also use queues heavily, avoid doing this.)
Looks like an interesting project. It'd be interesting to see someone who knows both Erlang and Go well explain this in comparative terms. I know Erlang reasonably well, but not Go.