|
|
|
|
|
by patcoll
4229 days ago
|
|
I've been using this library which helps with composing channels, and also has some nice implementations of useful patterns: 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.)