Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The one thing I would love to see a good story in chan/go concurrency in general for still is 1-to-n fanout. Right now a lock and a loop seems to be the answer, which is a bit of a blunt tool. Possible I'm missing an option, though!


1 producer to many consumers?

just spawn goroutines that select on the (optionally buffered) channel

if you need to fan out even further, repeat this on the spawned routines


Not quite. Produce one message, have arbitrary <n> consumers all read that exact message.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: