AnyEvent-MP
view release on metacpan or search on metacpan
=head2 CONFIGURATION/BINDS
To be able to be reached from other nodes, a node must I<bind> itself
to some listening socket(s). The list of these can either bs specified
manually, or AnyEvent::MP can guess them. Nodes without any binds are
possible to some extent.
=over 4
=item setbinds <host:port>,...
Sets the list of bind addresses explicitly - see the F<aemp setseeds>
command for the exact syntax. In addition, a value of C<*> for the port,
or not specifying a port, means to use a dynamically-assigned port.
Note that the C<*>, C<*:*> or C<*:port> patterns are very useful here.
Example: bind on a ephemeral port on all local interfaces.
aemp setbinds "*"
Example: bind on a random port on all local interfaces.
aemp setbinds "*:*"
Example: resolve "doomed.mydomain" and try to bind on port C<4040> of all
IP addressess returned.
aep setbinds doomed.mydomain:4040
=item delbinds
Removes the bind list again, which means it is inherited again from it's
parent profile, or stays unset.
=item addbind <host:port>
Adds a single bind address.
=item delbind <host:port>
Deletes the given bind address, if it exists.
=back
=head2 CONFIGURATION/SERVICES
Services are modules (or functions) that are automatically loaded (or
executed) when a node starts. They are especially useful when used in
conjunction with F<aemp run>, to configure which services a node should
run.
Despite the daunting name, services really I<are> nothing more than a
module name or a function name with arguments. The "service" aspect comes
only from the behaviour of the module or function, which is supposed to
implement, well, some kind of service for the node, network etc.
Instead of writing a standalone program for each different node type in
your network, you can simply put your code into a module, and then let the
configuration decide which node runs which "services". This also makes it
easy to combine multiple different services within the same node.
=over 4
=item setservices <initfunc>...
Sets or replaces the list of services, which must be specified as a
comma-separated list or a JSON array.
Each string entry in the list is interpreted as either a module name to
load (when it ends with C<::>) or a function to call (all other cases).
Each entry which is an array itself (you need to use JSON format to
specify those) is interpreted as a function name and the arguments to
pass.
The algorithm to find the function is the same as used for C<<
L<AnyEvent::MP>::spawn >>.
Example: run the global service.
aemp setservices AnyEvent::MP::Global::
Example: call the mymod::myfun function with arguments 1, 2 and 3.
aemp setservices '[["mymod::myfun", 1,2,3]]'
=item delservices
Removes the service list again, which means it is inherited again from
it's parent profile, or stays unset.
=item addservice <initfunc>
Adds a single service.
=item delservice <initfunc>
Deletes the given service, if it exists.
=item seteval <string>
Sometimes, all you need is to evaluate a small perl snippet to bring a
node up. This sets a perl string that is eval'ed after the node has been
configured.
=item deleval
Delete any eval string set with seteval.
=back
=head2 CONFIGURATION/PROFILE MANAGEMENT
All the above configuration functions by default affect the I<global
default configuration>, which is basically used to augment every profile
and node configuration.
=over 4
( run in 1.642 second using v1.01-cache-2.11-cpan-5837b0d9d2c )