> Can you help me understand why the patterns themselves need to be passed to your `await` function?
Because that way you can't `await` for a particular pattern ;) For example, we have a concept of playback states. One could need to wait until the playback state changes, so they could do
`await(pipeline, playback_state)`
and they would have the new playback state under the `playback_state` variable. But if they wanted to wait for a particular playback state, like `:playing`, they could do
`await(pipeline, :playing)`
I feel that would be a flexible way of handling scenarios when one needs to wait for a particular event. Anyway, I see two separate issues here
- The concept of waiting for a particular message by wrapping a receive block - like `Task.await`, `GenServer.call`
- Unpacking variables from a pattern passed to a macro - which is the problematic part here and as far as I understand it's not the Elixir way - in that case, we'll figure out something else, as it's definitely not worth going against the standards ;)