On Wednesday, May 11, 2011 5:11:55 AM UTC-7, Vladimir Sibirov wrote:
Can somebody show an example how to mux on arbitrary number of
channels? I mean channels coming from different goroutines, so it
isn't likely it is fine to use just one simple channel of struct

Should anyone come across this discussion today, 3 years later, there's
another solution: reflect.Select() takes an an arbitrary slice of
selectable objects and the return values are sufficient to emulate what the
keyword select does. Since the inputs are a slice you can alter the number
of channels dynamically. I have no idea whether it scales better than the
goroutine muxing suggestions.


-Nicolas S. Dade

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
postedNov 14, '14 at 9:01p
activeNov 14, '14 at 9:01p

1 user in discussion

Nic Dade: 1 post



site design / logo © 2022 Grokbase