… | |
… | |
375 | pass. |
375 | pass. |
376 | |
376 | |
377 | The algorithm to find the function is the same as used for C<< |
377 | The algorithm to find the function is the same as used for C<< |
378 | L<AnyEvent::MP>::spawn >>. |
378 | L<AnyEvent::MP>::spawn >>. |
379 | |
379 | |
380 | Example: run the globa service (which runs anyway, but this doesn't hurt). |
380 | Example: run the global service. |
381 | |
381 | |
382 | aemp setservices AnyEvent::MP::Global:: |
382 | aemp setservices AnyEvent::MP::Global:: |
383 | |
383 | |
384 | Example: call the mymod::myfun function with arguments 1, 2 and 3. |
384 | Example: call the mymod::myfun function with arguments 1, 2 and 3. |
385 | |
385 | |
… | |
… | |
395 | Adds a single service. |
395 | Adds a single service. |
396 | |
396 | |
397 | =item delservice <initfunc> |
397 | =item delservice <initfunc> |
398 | |
398 | |
399 | Deletes the given service, if it exists. |
399 | Deletes the given service, if it exists. |
|
|
400 | |
|
|
401 | =item seteval <string> |
|
|
402 | |
|
|
403 | Sometimes, all you need is to evaluate a small perl snippet to bring a |
|
|
404 | node up. This sets a perl string that is eval'ed after the node has been |
|
|
405 | configured. |
|
|
406 | |
|
|
407 | =item deleval |
|
|
408 | |
|
|
409 | Delete any eval string set with seteval. |
400 | |
410 | |
401 | =back |
411 | =back |
402 | |
412 | |
403 | =head2 CONFIGURATION/PROFILE MANAGEMENT |
413 | =head2 CONFIGURATION/PROFILE MANAGEMENT |
404 | |
414 | |
… | |
… | |
947 | splice @{ $profile->{services} }, $_, 1; |
957 | splice @{ $profile->{services} }, $_, 1; |
948 | last; |
958 | last; |
949 | } |
959 | } |
950 | ++$cfg->{dirty}; |
960 | ++$cfg->{dirty}; |
951 | }, |
961 | }, |
|
|
962 | seteval => sub { |
|
|
963 | @ARGV >= 1 |
|
|
964 | or die "eval string missing\n"; |
|
|
965 | |
|
|
966 | $profile->{eval} = shift @ARGV; |
|
|
967 | ++$cfg->{dirty}; |
|
|
968 | }, |
|
|
969 | deleval => sub { |
|
|
970 | delete $profile->{eval}; |
|
|
971 | ++$cfg->{dirty}; |
|
|
972 | }, |
952 | |
973 | |
953 | profile => sub { |
974 | profile => sub { |
954 | @ARGV >= 1 |
975 | @ARGV >= 1 |
955 | or die "profile name is missing\n"; |
976 | or die "profile name is missing\n"; |
956 | my $name = shift @ARGV; |
977 | my $name = shift @ARGV; |