[erlang-questions] Using 'monitor' with spawn_opt/3 throws badarg. Documentation bug?

Roger Lipscombe roger@REDACTED
Tue Feb 24 10:47:54 CET 2015


On 23 February 2015 at 23:53, Robert Virding <rvirding@REDACTED> wrote:
> The implication is that as it does not work with spawn_opt/5 which spawns a
> process on another node then it will also not work for spawn_opt/3 which
> does the same thing. Whether you give a fun or Mod,Fun,Args is irrelevant
> here.

Sure. My point is that the documentation for spawn_opt/3 says
"Otherwise works like spawn_opt/4". The documentation for spawn_opt/4
then proceeds to list 'monitor' as one of the options. It's only the
documentation for spawn_opt/5 that says that 'monitor' won't work.
Hence: the documentation could be clearer.

> Another reason for getting the badarg is the fun. To pass and call funs on
> other nodes requires exactly the same version of the module in which the fun
> is defined, in this case erl_eval. An easy way to test this is to just try
> and spawn the fun on the other node with spawn/2. If that works then this is
> not the problem.

That's not my problem, though it is useful to know. Both nodes are
running R16B03-1. Removing 'monitor' from the call to spawn_opt works
fine, except that I can't monitor the process. For which, see my other
email.



More information about the erlang-questions mailing list