Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I verify that an erlang process is hibernated?

Tags:

erlang

elixir

Is there a way to verify that an erlang process has been indeed hibernated. erlang:process_info/1 doesn't seem to provide this information and I can't think of anything else which might.

like image 477
loxs Avatar asked Feb 26 '18 17:02

loxs


2 Answers

Its current function should be erlang:hibernate/3.

1> erlang:process_info(Pid, current_function).
 {current_function,{erlang, hibernate, 3}}
like image 172
Pouriya Avatar answered Nov 07 '22 01:11

Pouriya


Here is how to do the same in Elixir:

iex(2)> :erlang.process_info(pid, :current_function)
{:current_function, {:erlang, :hibernate, 3}}
like image 36
loxs Avatar answered Nov 06 '22 23:11

loxs