ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MP/MP.pm
(Generate patch)

Comparing AnyEvent-MP/MP.pm (file contents):
Revision 1.68 by root, Fri Aug 28 23:06:33 2009 UTC vs.
Revision 1.71 by root, Sun Aug 30 19:52:56 2009 UTC

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
165Extracts and returns the node ID from a port ID or a node ID. 164Extracts 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
169Before a node can talk to other nodes on the network (i.e. enter 168Before 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
171to know is its own name, and optionally it should know the addresses of 170to know is its own name, and optionally it should know the addresses of
172some other nodes in the network to discover other nodes. 171some other nodes in the network to discover other nodes.
175never) before calling other AnyEvent::MP functions. 174never) before calling other AnyEvent::MP functions.
176 175
177The first argument is a profile name. If it is C<undef> or missing, then 176The first argument is a profile name. If it is C<undef> or missing, then
178the current nodename will be used instead (i.e. F<uname -n>). 177the current nodename will be used instead (i.e. F<uname -n>).
179 178
180The function then looks up the profile in the aemp configuration (see the 179The function first looks up the profile in the aemp configuration (see the
181L<aemp> commandline utility). 180L<aemp> commandline utility). the profile is calculated as follows:
181
182First, all remaining key => value pairs (all of which are conviniently
183undocumented at the moment) will be used. Then they will be overwritten by
184any values specified in the global default configuration (see the F<aemp>
185utility), then the chain of profiles selected, if any. That means that
186the values specified in the profile have highest priority and the values
187specified via C<initialise_node> have lowest priority.
182 188
183If the profile specifies a node ID, then this will become the node ID of 189If the profile specifies a node ID, then this will become the node ID of
184this process. If not, then the profile name will be used as node ID. The 190this process. If not, then the profile name will be used as node ID. The
185special node ID of C<anon/> will be replaced by a random node ID. 191special node ID of C<anon/> will be replaced by a random node ID.
186 192
188aemp protocol listeners on all binds specified (it is possible and valid 194aemp protocol listeners on all binds specified (it is possible and valid
189to have no binds, meaning that the node cannot be contacted form the 195to have no binds, meaning that the node cannot be contacted form the
190outside. This means the node cannot talk to other nodes that also have no 196outside. This means the node cannot talk to other nodes that also have no
191binds, but it can still talk to all "normal" nodes). 197binds, but it can still talk to all "normal" nodes).
192 198
193If the profile does not specify a binds list, then the node ID will be 199If the profile does not specify a binds list, then a default of C<*> is
194treated as if it were of the form C<host:port>, which will be resolved and 200used.
195used as binds list.
196 201
197Lastly, the seeds list from the profile is passed to the 202Lastly, the seeds list from the profile is passed to the
198L<AnyEvent::MP::Global> module, which will then use it to keep 203L<AnyEvent::MP::Global> module, which will then use it to keep
199connectivity with at least on of those seed nodes at any point in time. 204connectivity with at least on of those seed nodes at any point in time.
200 205

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines