-3

I start gen_fsm:

start_link() ->
     gen_fsm:start_link({global, ?MODULE}, [],
                   []).

How can i get it's PID?

Thank you.

0xAX
  • 20,957
  • 26
  • 117
  • 206

2 Answers2

5

If you check the documentation for gen_fsm:start_link/3 you'll see that it returns {ok, Pid}.

Adam Lindberg
  • 16,447
  • 6
  • 65
  • 85
1

You can either get it as the result of gen_fsm:start_link/3 or since it is a registered process using whereis(nameofprocess).

user601836
  • 3,215
  • 4
  • 38
  • 48