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.14 by root, Fri Aug 14 14:01:05 2009 UTC vs.
Revision 1.15 by root, Sun Aug 16 02:55:17 2009 UTC

57 57
58=cut 58=cut
59 59
60use common::sense; 60use common::sense;
61 61
62# must come before anything else
62BEGIN { 63BEGIN {
63 if ($ARGV[0] eq "run") { 64 if ($ARGV[0] eq "run") {
64 shift; 65 shift;
65 66
66 # d'oh 67 # d'oh
67 eval "use AnyEvent::Watchdog qw(autorestart heartbeat=300)"; 68 require AnyEvent::Watchdog;
69 AnyEvent::Watchdog::autorestart (1);
70 AnyEvent::Watchdog::heartbeat (300);
68 71
69 require AnyEvent; 72 require AnyEvent;
70 require AnyEvent::MP; 73 require AnyEvent::MP;
71 AnyEvent::MP::initialise_node (@ARGV); 74 AnyEvent::MP::initialise_node (@ARGV);
72 75
164 167
165 my $cv = AE::cv; 168 my $cv = AE::cv;
166 my $to = AE::timer 5, 0, sub { $cv->("timeout") }; 169 my $to = AE::timer 5, 0, sub { $cv->("timeout") };
167 mon $port, $cv; 170 mon $port, $cv;
168 my $reply = port { &$cv; 1 }; 171 my $reply = port { &$cv; 1 };
169 snd node_of $port, relay => $reply, "ok"; 172 snd node_of $port, snd => $reply, "ok";
170 173
171 print join " ", $cv->recv, "\n"; 174 print join " ", $cv->recv, "\n";
172 }, 175 },
173 176
174 rpc => sub { 177 rpc => sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines