How can I do:
select when x=channels.receive handle_receipt 0, x when x=channels.receive handle_receipt 1,x when timeout(30.seconds) handle_timeout end
…but with the size of the array of channels dynamically determined at runtime?
Looking in src/channels.cr I think there’s a way I could create an array of SelectAction objects, and pass those to Channel.non_blocking_select(), but it’s not clear exactly how I’d do that.
Does anyone have an example of doing this that I could cheat from?