[erlang-questions] Manually remove a message from Process Mailbox
Aggelos Giantsios
aggelgian@REDACTED
Fri Jan 4 21:21:37 CET 2013
The selective receive with a bound Msg worked like a charm.
Thanks for the help!!
Aggelos
On Fri, Jan 4, 2013 at 10:03 PM, Tony Rogvall <tony@REDACTED> wrote:
> Yes, of course :-)
>
> Not sure what I was drinking...
>
> /Tony
>
> On 4 jan 2013, at 20:55, Erik Søe Sørensen <eriksoe@REDACTED> wrote:
>
> [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 <aggelgian@REDACTED>
>
>> 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(),
>> messages).
>> 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?
>>
>> Thanks,
>> Aggelos
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
> "Installing applications can lead to corruption over time. Applications
> gradually write over each other's libraries, partial upgrades occur, user
> and system errors happen, and minute changes may be unnoticeable and
> difficult to fix"
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130104/7bbe0624/attachment.htm>
More information about the erlang-questions
mailing list