Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert remote pid to node name?

Tags:

erlang

When deciding one client parameter structure to one OTP gen_server, is it necessary to insert both Pid and Node name into the parameter structure?

Given one remote pid, is it possible to convert pid to node name? I mean full node name, like "[email protected]".

like image 350
Chen Yu Avatar asked Jan 16 '23 15:01

Chen Yu


2 Answers

Calling node(Pid) will return the name of the node on which Pid resides.

like image 80
rvirding Avatar answered Jan 25 '23 07:01

rvirding


Can someone explain the structure of a Pid in Erlang?

How do I found out which node an erlang process is running on?

like image 25
Sergey Miryanov Avatar answered Jan 25 '23 08:01

Sergey Miryanov