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

喜你入骨 提交于 2019-12-08 15:20:43

问题


Given that I can send PIDs from a process to an other, even across nodes, if I receive a Pid from a process within a different process (possibly on a different node) how do I find out which node the PID in question runs in/on?

erlang:process_info(Pid) does not seem to have that information in it.

Thanks.


回答1:


erlang:node/1

node(Arg) -> Node

Returns the node where Arg is located. Arg can be a pid, a reference, or a port. If the local node is not alive, nonode@nohost is returned.



来源:https://stackoverflow.com/questions/7083980/how-do-i-found-out-which-node-an-erlang-process-is-running-on

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!