[erlang-questions] Using 'monitor' with spawn_opt/3 throws badarg. How to monitor a remote process?

Kenneth Lakin kennethlakin@REDACTED
Tue Feb 24 07:34:43 CET 2015

Roger Lipscombe asks:
> How do I monitor a process that I spawn on a remote node?

Some searching pulls up this message from a similar thread:
and this reply:

I *think* that that thread says that monitoring of remote processes is
not supported by the distribution protocol. I probably seriously
misunderstand what's going on, but it sort of looks like this program
indicates that you *can* monitor remote processes:

Fun = fun() -> timer:sleep(timer:seconds(5)),
  io:format("Hello from ~p~n", [node()]) end,
Pid = spawn_opt(one@REDACTED, Fun, [link]),
monitor(process, Pid),

Hello from one@REDACTED
Shell got {'DOWN',#Ref<>,process,<7323.94.0>,normal}

Again. I'm probably deeply confused here.

-Kenneth Lakin

PS: Apologies for breaking threading. I just joined the list. (And,
apologies to the moderator for the earlier half-composed email!)

More information about the erlang-questions mailing list