我如何找出运行erlang进程的哪个节点? [英] How do I found out which node an erlang process is running on?

查看:501
本文介绍了我如何找出运行erlang进程的哪个节点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于我可以将PID从进程发送到另一个进程,即使在节点之间,如果我从不同进程(可能在不同的节点)处的进程接收到Pid,我如何知道哪个节点是有问题的PID运行在/ on?



erlang:process_info(Pid)似乎没有该信息。 / p>

谢谢。

解决方案

erlang:node / 1


节点(Arg) - > Node



返回Arg所在的节点。 Arg可以是pid,引用或端口。如果本地节点不存在,则返回nonode @ nohost。



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.

解决方案

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.

这篇关于我如何找出运行erlang进程的哪个节点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆