File: unknown_erlang_nodes_func.txt

package info (click to toggle)
erlang 1%3A27.3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 225,000 kB
  • sloc: erlang: 1,658,966; ansic: 405,769; cpp: 177,850; xml: 82,435; makefile: 15,031; sh: 14,401; lisp: 9,812; java: 8,603; asm: 6,541; perl: 5,836; python: 5,484; sed: 72
file content (99 lines) | stat: -rw-r--r-- 4,397 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

  nodes()

  Returns a list of all nodes connected to this node through normal
  connections (that is, hidden nodes are not listed). Same as
  nodes(visible).

  nodes(Arg)

  Returns a list of nodes according to the argument specified. The
  returned result, when the argument is a list, is the list of nodes
  satisfying the disjunction(s) of the list elements.

  NodeTypes:

   • visible - Nodes connected to this node through normal
     connections.

   • hidden - Nodes connected to this node through hidden
     connections.

   • connected - All nodes connected to this node.

   • this - This node.

   • known - Nodes that are known to this node. That is,
     connected nodes and nodes referred to by process
     identifiers, port identifiers, and references located on
     this node. The set of known nodes is garbage collected.
     Notice that this garbage collection can be delayed. For more
     information, see erlang:system_info(delayed_node_table_gc).

  Some equalities: [node()] = nodes(this), nodes(connected) =
  nodes([visible, hidden]), and nodes() = nodes(visible).

  nodes(Arg, InfoOpts)

Since:
  OTP 25.1

  Returns a list of NodeInfo tuples.

  The first element is the node name. Nodes to be included in the
  list are determined by the first argument Arg in the same way as
  for nodes(Arg). The second element of NodeInfo tuples is a map
  containing further information about the node identified by the
  first element. The information present in this map is determined
  by the InfoOpts map passed as the second argument. Currently the
  following associations are allowed in the InfoOpts map:

   • connection_id => boolean() - If the value of the
     association equals true, the Info map in the returned
     result will contain the key connection_id associated with
     the value ConnectionId. If ConnectionId equals 
     undefined, the node is not connected to the node which the
     caller is executing on, or is the node which the caller is
     executing on. If ConnectionId is an integer, the node is
     currently connected to the node which the caller is
     executing on.

     The integer connection identifier value together with a node
     name identifies a specific connection instance to the node
     with that node name. The connection identifier value is node
     local. That is, on the other node the connection identifier
     will not be the same value. If a connection is taken down
     and then taken up again, the connection identifier value
     will change for the connection to that node. The amount of
     values for connection identifiers are limited, so it is
     possible to see the same value for different instances, but
     quite unlikely. It is undefined how the value change between
     two consecutive connection instances.

   • node_type => boolean() - If the value of the association
     equals true, the Info map in the returned result will
     contain the key node_type associated with the value 
     NodeTypeInfo. Currently the following node types exist:

      ○ visible - The node is connected to the node of the
        calling process through an ordinary visible
        connection. That is, the node name would appear in the
        result returned by nodes/0.

      ○ hidden - The node is connected to the node of the
        calling process through a hidden connection. That is,
        the node name would not appear in the result
        returned by nodes/0.

      ○ this - This is the node of the calling process.

      ○ known - The node is not connected but known to the
        node of the calling process.

  Example:

    (a@localhost)1> nodes([this, connected], #{connection_id=>true, node_type=>true}).
    [{c@localhost,#{connection_id => 13892108,node_type => hidden}},
     {b@localhost,#{connection_id => 3067553,node_type => visible}},
     {a@localhost,#{connection_id => undefined,node_type => this}}]
    (a@localhost)2>