In the Erlang shell, flush()
can be used to get the shell process's message queue.
Is it possible to know the message queue length of another process by knowing its PID?
Just use
erlang:process_info(Pid, message_queue_len)
The result will be a tuple {message_queue_len, *yourdesiredvalue*}
If you want the entire message list, use
erlang:process_info(Pid, messages)
See Erlang specs for detailed information and the complete list of valid data atoms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With