[erlang-questions] automatically delete older messages with the same tag (atom)?

Giorgos Kollias gidiko@REDACTED
Tue May 5 17:04:55 CEST 2009


Hello Erlang users,

Is there an option in the Erlang runtime to automatically delete a message
that has been deposited into a process's mailbox as soon as a newer message
with the same tag arrives? Is it easy to "patch" the Erlang language source
code to support this "little" feature in case this is not there?

Or the only feasible way of getting this behavior is just to receive all
messages till you get a sort of timeout and just keep the latest message
with the tag you are interested in (i.e. user code only) in each receive
phase? Is there a standard code idiom/snippet for this?

This feature would be very interesting for implementing the asynchronous
iterations computing paradigm where each process only keeps the most
up-to-date message when it looks into its incoming messages.

Thanks in advance,

giorgos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090505/9e6d6c55/attachment.htm>


More information about the erlang-questions mailing list