[erlang-questions] erlang:monitor(node, NodeName) could obsolate monitor_node/2

Andrew Stone stondage123@REDACTED
Fri Oct 31 17:52:41 CET 2008


I use net_kernel:monitor_nodes and it works just like expected. I think
erlang:monitor_node should be deprecated. It isn't even as full
featured as net_kernel:monitor_node, since it can't receive nodeup
messages.

However, I also like the idea to make monitor work on nodes also just for consistency sake.

-Andrew


----- Original Message ----
From: Ulf Wiger <ulf@REDACTED>
To: Andras Georgy Bekes <bekesa@REDACTED>
Cc: erlang-questions@REDACTED
Sent: Friday, October 31, 2008 12:22:42 PM
Subject: Re: [erlang-questions] erlang:monitor(node, NodeName) could obsolate monitor_node/2

This seems reasonable. The function that's harder to replace is
net_kernel:monitor_nodes(Bool), which also delivers {nodeup,N}
messages. One could also argue that given the existence of
net_kernel:monitor_nodes/[1,2], no other node monitoring function
is really needed.  ;-)

BR,
Ulf W

2008/10/31 Andras Georgy Bekes <bekesa@REDACTED>:
> Hi,
>
> >From the documentation:
> "erlang:monitor(Type, Item) -> MonitorRef:
> ...
> Currently only processes can be monitored, i.e. the only allowed Type
> is 'process', but other types may be allowed in the future."
>
> It seems to me that a new type 'node' could be allowed easily, using the
> node name as the reference to the monitored object. The delivered
> message obvoisly should be {'DOWN', MonitorRef, node, NodeName, Info}.
>
> This could completely take over the role of the current monitor_node/2,
> which could be obsolated.
>
> Questions: Are there any uses of the current monitor_node/2 that can not
> be done (easily) with the above extension of monitor/2 ?
> Are there any reasons for having two different monitoring methods for
> nodes and processes, besides history?
>
> If no, I think we should take this step.
>
>        Georgy
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list