Erlang : RPC to a node with output on that node

后端 未结 1 1111
星月不相逢
星月不相逢 2021-01-02 11:37

Is there a way to make an rpc call to a node, but have the output displayed on that node, not just on the calling node ( in fact I would not be too bothered if the calling

相关标签:
1条回答
  • 2021-01-02 12:05

    Try ;-)

    rpc:call( Node, c, ls, [] ).
    

    or when you want display it on Node

    spawn(Node, fun()->group_leader(whereis(user),self()), c:ls() end).
    

    or much more funny example which redirect output of local process to another terminal of Node

    group_leader(rpc:call(Node, erlang, whereis, [user]), self()),
    c:ls(),
    group_leader(whereis(user), self()).
    
    0 讨论(0)
提交回复
热议问题