Hi,
first of all, I'm a big fan of the changes being proposed here since in my code I prefer the 'union' style of logic over the OO style.
I was curious, though, if there are any plans for the match operator to support async stuff. I'm interested in the problem of waiting on multiple asyncio tasks concurrently, and having a branch of code execute depending on the task.
Currently this can be done by using
asyncio.wait, looping over the done set and executing an if-else chain there, but this is quite tiresome. Go has a select statement (
https://tour.golang.org/concurrency/5) that looks like this:
select {
case <-ch1:
fmt.Println("Received from ch1")
case <-ch2:
fmt.Println("Received from ch2")
}
Speaking personally, this is a Go feature I miss a lot when writing asyncio code. The syntax is similar to what's being proposed here. Although it could be a separate thing added later,
async match, I guess.