I have a process code, and i want to send a 'die' question to kill it. But i want to make sure that every time the kill message is prioritized, so if there is one - the process will die immediately.
receive
die -> dead;
after
0 -> receive
Message -> do_something(Message)
after
0 -> func(NewX)
end
end.