priority_receive v0.1.0 API Reference
Modules
In Erlang/Elixir we can use selective receives to receive higher priority messages first,
but it is not possible to receive messages with different priority levels with a single
call to receive
. Actually to select a message, erlang matches that message against all
clauses before going to the next message. Therefore selecting messages with different
priorities, needs nested receives. And to avoid deadlocks you have to put all higher
priority match clauses in nested lower priority receives.