Reputation: 4077
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?
Upvotes: 14
Views: 8093
Reputation: 3869
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.
Upvotes: 33