… | |
… | |
162 | |
162 | |
163 | =item $nodeid = node_of $port |
163 | =item $nodeid = node_of $port |
164 | |
164 | |
165 | Extracts and returns the node ID from a port ID or a node ID. |
165 | Extracts and returns the node ID from a port ID or a node ID. |
166 | |
166 | |
167 | =item initialise_node $profile_name |
167 | =item initialise_node $profile_name, key => value... |
168 | |
168 | |
169 | Before a node can talk to other nodes on the network (i.e. enter |
169 | Before a node can talk to other nodes on the network (i.e. enter |
170 | "distributed mode") it has to initialise itself - the minimum a node needs |
170 | "distributed mode") it has to initialise itself - the minimum a node needs |
171 | to know is its own name, and optionally it should know the addresses of |
171 | to know is its own name, and optionally it should know the addresses of |
172 | some other nodes in the network to discover other nodes. |
172 | some other nodes in the network to discover other nodes. |
… | |
… | |
175 | never) before calling other AnyEvent::MP functions. |
175 | never) before calling other AnyEvent::MP functions. |
176 | |
176 | |
177 | The first argument is a profile name. If it is C<undef> or missing, then |
177 | The first argument is a profile name. If it is C<undef> or missing, then |
178 | the current nodename will be used instead (i.e. F<uname -n>). |
178 | the current nodename will be used instead (i.e. F<uname -n>). |
179 | |
179 | |
180 | The function then looks up the profile in the aemp configuration (see the |
180 | The function first looks up the profile in the aemp configuration (see the |
181 | L<aemp> commandline utility). |
181 | L<aemp> commandline utility). the profile is calculated as follows: |
|
|
182 | |
|
|
183 | First, all remaining key => value pairs will be used. Then they will be |
|
|
184 | overwritten by any values specified in the global default configuration |
|
|
185 | (see the F<aemp> utility), then the chain of profiles selected, if |
|
|
186 | any. That means that the values specified in the profile have highest |
|
|
187 | priority and the values specified via C<initialise_node> have lowest |
|
|
188 | priority. |
182 | |
189 | |
183 | If the profile specifies a node ID, then this will become the node ID of |
190 | If the profile specifies a node ID, then this will become the node ID of |
184 | this process. If not, then the profile name will be used as node ID. The |
191 | this process. If not, then the profile name will be used as node ID. The |
185 | special node ID of C<anon/> will be replaced by a random node ID. |
192 | special node ID of C<anon/> will be replaced by a random node ID. |
186 | |
193 | |