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

Comparing AnyEvent-MP/bin/aemp (file contents):
Revision 1.10 by root, Thu Aug 13 15:29:59 2009 UTC vs.
Revision 1.11 by root, Thu Aug 13 22:32:41 2009 UTC

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
49With aemp you can configure various aspects of AnyEvent::MP and its 52With aemp you can configure various aspects of AnyEvent::MP and its
50protocol. 53protocol.
112 115
113 $node = (resolve_node $node)->recv; 116 $node = (resolve_node $node)->recv;
114 "$node#$port" 117 "$node#$port"
115} 118}
116 119
120sub 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
117sub docmd; 152sub docmd;
118 153
119our %CMD = ( 154our %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";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines