[erlang-questions] 2 (unrelated) questions.

Barco You barcojie@REDACTED
Thu Oct 27 14:00:19 CEST 2011


register() does not support remote process because it can not recognize
remote pod(), I guess.

Regards,
Barco
On Oct 27, 2011 4:34 AM, "Geoff Cant" <nem@REDACTED> wrote:

> On 2011-10-26, at 08:25 , Paul Barry wrote:
> > Q2. Being able to register a spawned process is cool, but why can't I
> > register a process that is spawned remotely?  That is, why does this
> > line of code give me a "badarg"?
> >
> >     register(the_board, spawn('server@REDACTED', displayboard,
> > putmessage, [])).
>
>
> You can only register local pids and ports. I'm not sure why this
> restriction is enforced - maybe the erts people have more information.
>
> In practice it's easy to work around. Register the name on the remote node
> and then use the {the_board, 'server@REDACTED'} ({RegisteredName, Node})
> form instead of using a bare registered name or pid. This form is a valid
> argument to the ! send function.
>
> As others have mentioned there are other process registries you can use
> (gproc, ngproc, proc_reg, global) that allow the registration of remote pids
> (and usually allow names to be terms instead of just atoms).
>
> Cheers,
> --
> Geoff Cant
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111027/8e5be069/attachment.htm>


More information about the erlang-questions mailing list