… | |
… | |
38 | mon $port, $otherport # kill otherport on abnormal death |
38 | mon $port, $otherport # kill otherport on abnormal death |
39 | mon $port, $otherport, @msg # send message on death |
39 | mon $port, $otherport, @msg # send message on death |
40 | |
40 | |
41 | =head1 CURRENT STATUS |
41 | =head1 CURRENT STATUS |
42 | |
42 | |
|
|
43 | bin/aemp - stable. |
43 | AnyEvent::MP - stable API, should work |
44 | AnyEvent::MP - stable API, should work. |
44 | AnyEvent::MP::Intro - outdated |
45 | AnyEvent::MP::Intro - uptodate, but incomplete. |
45 | AnyEvent::MP::Kernel - mostly stable |
46 | AnyEvent::MP::Kernel - mostly stable. |
46 | AnyEvent::MP::Global - mostly stable |
47 | AnyEvent::MP::Global - stable API, protocol not yet final. |
47 | AnyEvent::MP::Node - mostly stable, but internal anyways |
|
|
48 | AnyEvent::MP::Transport - mostly stable, but internal anyways |
|
|
49 | |
48 | |
50 | stay tuned. |
49 | stay tuned. |
51 | |
50 | |
52 | =head1 DESCRIPTION |
51 | =head1 DESCRIPTION |
53 | |
52 | |
… | |
… | |
162 | |
161 | |
163 | =item $nodeid = node_of $port |
162 | =item $nodeid = node_of $port |
164 | |
163 | |
165 | Extracts and returns the node ID from a port ID or a node ID. |
164 | Extracts and returns the node ID from a port ID or a node ID. |
166 | |
165 | |
167 | =item initialise_node $profile_name |
166 | =item initialise_node $profile_name, key => value... |
168 | |
167 | |
169 | Before a node can talk to other nodes on the network (i.e. enter |
168 | 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 |
169 | "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 |
170 | 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. |
171 | some other nodes in the network to discover other nodes. |
… | |
… | |
175 | never) before calling other AnyEvent::MP functions. |
174 | never) before calling other AnyEvent::MP functions. |
176 | |
175 | |
177 | The first argument is a profile name. If it is C<undef> or missing, then |
176 | 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>). |
177 | the current nodename will be used instead (i.e. F<uname -n>). |
179 | |
178 | |
180 | The function then looks up the profile in the aemp configuration (see the |
179 | The function first looks up the profile in the aemp configuration (see the |
181 | L<aemp> commandline utility). |
180 | L<aemp> commandline utility). the profile is calculated as follows: |
|
|
181 | |
|
|
182 | First, all remaining key => value pairs (all of which are conviniently |
|
|
183 | undocumented at the moment) will be used. Then they will be overwritten by |
|
|
184 | any values specified in the global default configuration (see the F<aemp> |
|
|
185 | utility), then the chain of profiles selected, if any. That means that |
|
|
186 | the values specified in the profile have highest priority and the values |
|
|
187 | specified via C<initialise_node> have lowest priority. |
182 | |
188 | |
183 | If the profile specifies a node ID, then this will become the node ID of |
189 | 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 |
190 | 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. |
191 | special node ID of C<anon/> will be replaced by a random node ID. |
186 | |
192 | |
… | |
… | |
188 | aemp protocol listeners on all binds specified (it is possible and valid |
194 | aemp protocol listeners on all binds specified (it is possible and valid |
189 | to have no binds, meaning that the node cannot be contacted form the |
195 | to have no binds, meaning that the node cannot be contacted form the |
190 | outside. This means the node cannot talk to other nodes that also have no |
196 | outside. This means the node cannot talk to other nodes that also have no |
191 | binds, but it can still talk to all "normal" nodes). |
197 | binds, but it can still talk to all "normal" nodes). |
192 | |
198 | |
193 | If the profile does not specify a binds list, then the node ID will be |
199 | If the profile does not specify a binds list, then a default of C<*> is |
194 | treated as if it were of the form C<host:port>, which will be resolved and |
200 | used. |
195 | used as binds list. |
|
|
196 | |
201 | |
197 | Lastly, the seeds list from the profile is passed to the |
202 | Lastly, the seeds list from the profile is passed to the |
198 | L<AnyEvent::MP::Global> module, which will then use it to keep |
203 | L<AnyEvent::MP::Global> module, which will then use it to keep |
199 | connectivity with at least on of those seed nodes at any point in time. |
204 | connectivity with at least on of those seed nodes at any point in time. |
200 | |
205 | |