Re: [go-nuts] How to pass a value to multiple readers of a shared channel

2017-10-16 Thread roger peppe
The answer depends on whether you have just one value or many. For a single value (sometimes known as a "future"), I tend to pair a chan of struct{} with a value to be set. To make the value available, set it, then close the channel. Readers wait on the channel, then read the value. For a successi

[go-nuts] How to pass a value to multiple readers of a shared channel

2017-10-15 Thread st ov
A value sent through a channel can be read by only one reader, so once its read its no longer available to other readers is that right? In what ways can I pass/communicate/distribute a value through a channel and have it shared across an unknown number of readers? -- You received this message