[erlang-questions] Manually remove a message from Process Mailbox
Erik Søe Sørensen
Fri Jan 4 20:55:08 CET 2013
[forgot to write the list]
That would be
receive TheMsg when TheMsg=:=Msg -> ok end
(or shorter but perhaps less clear:
receive Msg -> ok end
where Msg is already bound)
assuming of course that you won't be trying to remove the non-first copy of
a specific message - but given that you say you're trying to emulate the
receive expression, and that doesn't allow it, then the above should be
what you want.
2013/1/4 Aggelos Giantsios <>
> Happy New Year to everyone!
> I am trying to simulate the 'receive' expression behaviour.
> I access the process message queue with erlang:process_info(self(),
> Assuming I have selected a message Msg which is at position k in the
> message list and have safely stored it in a variable,
> is there a way to manually remove Msg from the process message queue?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions