开发者

erlang: anything like name_for_pid()?

开发者 https://www.devze.com 2023-01-21 14:48 出处:网络
Is there a way t开发者_运维百科o get a registered name if you have a PID?I\'m assuming you want this for some kind of debugging/introspection purpose and not for general use in your code:

Is there a way t开发者_运维百科o get a registered name if you have a PID?


I'm assuming you want this for some kind of debugging/introspection purpose and not for general use in your code:

erlang:process_info(Pid, registered_name).

Gives you [] if the process doesn't have a locally registered name, and {registered_name, Name} if there is one.

0

精彩评论

暂无评论...
验证码 换一张
取 消