[erlang-questions] Terminate process if it is slow at receiving messages

akonsu akonsu@REDACTED
Fri Sep 20 20:17:56 CEST 2013

thanks everyone.


would you please explain what you mean by controlling the sender? Who would
control the sender? why? Are you referring to the idea of sending an
acknowledgement message and are proposing to use gen_server:call instead?

Also, if I still want messages, the only way I know to get the queue length
is to use process_info(self(),message_queue_len). Do you know if this call
is expensive? Can I call this function often? I read that it is not
advisable to call process_info/1 except for debugging, but it seems that
process_info/2 is designed to be used in production.


2013/9/20 Max Lapshin <max.lapshin@REDACTED>

> I would advise you to use gen_server:call and control sender this way.
> I've removed almost all async message sendings in erlyvideo and changed
> them to gen_server:call.
> But if you still want message sending, you can for example, kill all
> children with message_queue_len > 500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130920/248bd163/attachment.htm>

More information about the erlang-questions mailing list