Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view one specified process message queue if the process's pid is know?

Tags:

erlang

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?

like image 964
Chen Yu Avatar asked Mar 09 '12 10:03

Chen Yu


1 Answers

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.

like image 172
Vincenzo Maggio Avatar answered Nov 16 '22 02:11

Vincenzo Maggio