Remote sites, group leaders, and printouts

Given the two Erlang nodes, "foo @host" and "bar @host", the following prints out to "foo":

(foo@host) rpc:call('bar@host', io, format, ["~p", [test]]).

While the "bar" displays the following:

(foo@host) rpc:call('bar@host', erlang, display, [test]).

Even if erlang:display/1it is intended to be used only for debugging, both functions should send material to standard output. Each process should inherit the group leader from its parent, so I would expect the two functions to behave in a consistent manner.

Is there any justification for the above behavior?

+5
source share
1 answer

The reason for this difference in behavior is where and by whom the conclusion is made:

  • erlang:display/1 BIF BEAM, , io- Erlang. , bar bar .

  • io:format/1/2 Erlang io. IoDevice, io- . rpc:call/4 , - , RPC. , . , RPC foo node bar foo.

. , Erlang , , , .

+12
source

All Articles