Re: [go-nuts] Interesting "select" examples

2023-04-07 Thread Andrew Harris
I was surprised looking through old code that I didn't have much in the way of "interesting, non-trivial" selects - in every case where I remember doing something interesting through a select statement, later versions had moved to less interesting selects, more interesting messages from channels

Re: [go-nuts] Interesting "select" examples

2023-04-07 Thread Bakul Shah
> On Apr 4, 2023, at 6:20 AM, Jesper Louis Andersen > wrote: > > On Tue, Apr 4, 2023 at 2:22 AM Nigel Tao > wrote: >> >> I'd have to study mux9p for longer, but its select chooses between two >> receives, so it could possibly collapse to a single heterogenous >> c

[go-nuts] Re: Interesting "select" examples

2023-04-07 Thread p...@morth.org
Sarama's producer might qualify as interesting. https://pkg.go.dev/github.com/Shopify/sarama#example-AsyncProducer-Select You're supposed to produce messages on a channel while simultaneously listening for acks (optional) and errors (mandatory) in the same select loop. Regards, Per Johansson O