… | |
… | |
763 | }; |
763 | }; |
764 | } |
764 | } |
765 | |
765 | |
766 | $cv->end; |
766 | $cv->end; |
767 | |
767 | |
|
|
768 | ... |
|
|
769 | |
|
|
770 | my $results = $cv->recv; |
|
|
771 | |
768 | This code fragment supposedly pings a number of hosts and calls |
772 | This code fragment supposedly pings a number of hosts and calls |
769 | C<send> after results for all then have have been gathered - in any |
773 | C<send> after results for all then have have been gathered - in any |
770 | order. To achieve this, the code issues a call to C<begin> when it starts |
774 | order. To achieve this, the code issues a call to C<begin> when it starts |
771 | each ping request and calls C<end> when it has received some result for |
775 | each ping request and calls C<end> when it has received some result for |
772 | it. Since C<begin> and C<end> only maintain a counter, the order in which |
776 | it. Since C<begin> and C<end> only maintain a counter, the order in which |
… | |
… | |
1234 | |
1238 | |
1235 | BEGIN { AnyEvent::common_sense } |
1239 | BEGIN { AnyEvent::common_sense } |
1236 | |
1240 | |
1237 | use Carp (); |
1241 | use Carp (); |
1238 | |
1242 | |
1239 | our $VERSION = '7.03'; |
1243 | our $VERSION = '7.04'; |
1240 | our $MODEL; |
1244 | our $MODEL; |
1241 | our @ISA; |
1245 | our @ISA; |
1242 | our @REGISTRY; |
1246 | our @REGISTRY; |
1243 | our $VERBOSE; |
1247 | our $VERBOSE; |
1244 | our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred |
1248 | our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred |