… | |
… | |
41 | aemp delservice <initfunc> # delete one instance of a service |
41 | aemp delservice <initfunc> # delete one instance of a service |
42 | |
42 | |
43 | # profile-specific configuration |
43 | # profile-specific configuration |
44 | aemp profile <name> <command>... # apply command to profile only |
44 | aemp profile <name> <command>... # apply command to profile only |
45 | aemp delprofile <name> # eradicate the named profile |
45 | aemp delprofile <name> # eradicate the named profile |
|
|
46 | |
|
|
47 | # debugging |
|
|
48 | aemp trace <noderef> # trace the network topology |
46 | |
49 | |
47 | =head1 DESCRIPTION |
50 | =head1 DESCRIPTION |
48 | |
51 | |
49 | With aemp you can configure various aspects of AnyEvent::MP and its |
52 | With aemp you can configure various aspects of AnyEvent::MP and its |
50 | protocol. |
53 | protocol. |
… | |
… | |
112 | |
115 | |
113 | $node = (resolve_node $node)->recv; |
116 | $node = (resolve_node $node)->recv; |
114 | "$node#$port" |
117 | "$node#$port" |
115 | } |
118 | } |
116 | |
119 | |
|
|
120 | sub trace { |
|
|
121 | my ($node) = @_; |
|
|
122 | my $cv = AE::cv; |
|
|
123 | my %seen; |
|
|
124 | |
|
|
125 | my $to = AE::timer 15, 0, sub { |
|
|
126 | warn "timeout\n"; |
|
|
127 | $cv->(); |
|
|
128 | }; |
|
|
129 | |
|
|
130 | initialise_node "slave/", $node; |
|
|
131 | |
|
|
132 | my $reply = port { |
|
|
133 | print +(join " ", @_), "\n"; |
|
|
134 | |
|
|
135 | shift; |
|
|
136 | for (@_) { |
|
|
137 | unless ($seen{$_}++) { |
|
|
138 | $cv->begin; |
|
|
139 | snd $_, up_nodes => $SELF => $_; |
|
|
140 | } |
|
|
141 | } |
|
|
142 | |
|
|
143 | $cv->end; |
|
|
144 | }; |
|
|
145 | |
|
|
146 | $cv->begin; |
|
|
147 | snd $reply, seed => $node; |
|
|
148 | |
|
|
149 | $cv->recv; |
|
|
150 | } |
|
|
151 | |
117 | sub docmd; |
152 | sub docmd; |
118 | |
153 | |
119 | our %CMD = ( |
154 | our %CMD = ( |
120 | snd => sub { |
155 | snd => sub { |
121 | my $port = resolve_port shift @ARGV; |
156 | my $port = resolve_port shift @ARGV; |
… | |
… | |
149 | my $port = resolve_port shift @ARGV; |
184 | my $port = resolve_port shift @ARGV; |
150 | initialise_node "slave/", node_of $port; |
185 | initialise_node "slave/", node_of $port; |
151 | |
186 | |
152 | mon $port, my $cv = AE::cv; |
187 | mon $port, my $cv = AE::cv; |
153 | print join " ", $cv->recv, "\n"; |
188 | print join " ", $cv->recv, "\n"; |
|
|
189 | }, |
|
|
190 | |
|
|
191 | trace => sub { |
|
|
192 | @ARGV >= 1 |
|
|
193 | or die "noderef missing\n"; |
|
|
194 | |
|
|
195 | trace +(resolve_node shift @ARGV)->recv; |
154 | }, |
196 | }, |
155 | |
197 | |
156 | setnoderef => sub { |
198 | setnoderef => sub { |
157 | @ARGV >= 1 |
199 | @ARGV >= 1 |
158 | or die "shared secret missing\n"; |
200 | or die "shared secret missing\n"; |