… | |
… | |
11 | # protocol commands |
11 | # protocol commands |
12 | aemp snd <port> <arg...> # send a message |
12 | aemp snd <port> <arg...> # send a message |
13 | aemp mon <port> # wait till port is killed |
13 | aemp mon <port> # wait till port is killed |
14 | aemp rpc <port> <arg...> # send message, append reply |
14 | aemp rpc <port> <arg...> # send message, append reply |
15 | aemp eval <node> <expr...> # evaluate expression |
15 | aemp eval <node> <expr...> # evaluate expression |
|
|
16 | aemp trace <nodeid> # trace the network topology |
16 | |
17 | |
17 | # run a node |
18 | # run a node |
18 | aemp run initialise_args... # run a node |
19 | aemp run initialise_args... # run a node |
19 | |
20 | |
20 | # node configuration: protocol endpoints |
21 | # node configuration: protocol endpoints |
… | |
… | |
53 | aemp profile <name> <command>... # apply command to profile only |
54 | aemp profile <name> <command>... # apply command to profile only |
54 | aemp delprofile <name> # eradicate the named profile |
55 | aemp delprofile <name> # eradicate the named profile |
55 | aemp showprofile <name> # display given profile |
56 | aemp showprofile <name> # display given profile |
56 | aemp showconfig <name> # display effective config |
57 | aemp showconfig <name> # display effective config |
57 | |
58 | |
58 | # debugging |
|
|
59 | aemp trace <nodeid> # trace the network topology |
|
|
60 | |
|
|
61 | =head1 DESCRIPTION |
59 | =head1 DESCRIPTION |
62 | |
60 | |
63 | With aemp you can configure various aspects of AnyEvent::MP and its |
61 | With aemp you can configure various aspects of AnyEvent::MP and its |
64 | protocol. |
62 | protocol, send various messages and even run a node. |
65 | |
|
|
66 | You can also start a "default node", a node that only depends on the |
|
|
67 | static configuration. |
|
|
68 | |
63 | |
69 | =cut |
64 | =cut |
70 | |
65 | |
71 | use common::sense; |
66 | use common::sense; |
72 | |
67 | |
73 | # should come before anything else, so all modules |
68 | # should come before anything else, so all modules |
74 | # will be loaded on each restart |
69 | # will be loaded on each restart |
75 | #BEGIN { |
70 | BEGIN { |
76 | if ($ARGV[0] eq "run") { |
71 | if ($ARGV[0] eq "run") { |
77 | shift; |
72 | shift; |
78 | |
73 | |
79 | # d'oh |
74 | # d'oh |
80 | # require AnyEvent::Watchdog; |
75 | require AnyEvent::Watchdog; |
81 | # now we can load extra modules |
76 | # now we can load extra modules |
82 | |
77 | |
83 | # AnyEvent::Watchdog::autorestart (1); |
78 | AnyEvent::Watchdog::autorestart (1); |
84 | # AnyEvent::Watchdog::heartbeat (300); |
79 | AnyEvent::Watchdog::heartbeat (300); |
85 | |
80 | |
86 | require AnyEvent; |
81 | require AnyEvent; |
87 | require AnyEvent::MP; |
82 | require AnyEvent::MP; |
88 | AnyEvent::MP::initialise_node (@ARGV); |
83 | AnyEvent::MP::initialise_node (@ARGV); |
89 | |
84 | |
90 | AnyEvent::detect () eq "AnyEvent::Impl::EV" |
85 | AnyEvent::detect () eq "AnyEvent::Impl::EV" |
91 | ? EV::loop () |
86 | ? EV::loop () |
92 | : AE::cv ()->recv; |
87 | : AE::cv ()->recv; |
93 | } |
88 | } |
94 | #} |
89 | } |
95 | |
90 | |
96 | use Carp (); |
91 | use Carp (); |
97 | |
92 | |
98 | use JSON::XS; |
93 | use JSON::XS; |
99 | |
94 | |