Revision: | 1.8 |
Committed: | Mon Nov 24 04:56:38 2008 UTC (15 years, 7 months ago) by root |
Branch: | MAIN |
Changes since 1.7: | +1 -1 lines |
Log Message: | *** empty log message *** |
# | User | Rev | Content |
---|---|---|---|
1 | root | 1.1 | #!/usr/bin/perl |
2 | |||
3 | use Coro; | ||
4 | root | 1.8 | use Coro::AnyEvent; |
5 | root | 1.5 | use Coro::LWP; # should be use'd as early as possible |
6 | root | 1.1 | use LWP::Simple; |
7 | |||
8 | root | 1.3 | $SIG{PIPE} = 'IGNORE'; |
9 | |||
10 | root | 1.6 | my @pids; |
11 | |||
12 | root | 1.7 | for (1..1) { |
13 | push @pid, async { | ||
14 | print "starting to fetch http://www.google.de/\n"; | ||
15 | get "http://www.google.de/"; | ||
16 | print "fetched http://www.google.de/\n"; | ||
17 | }; | ||
18 | root | 1.4 | |
19 | root | 1.7 | push @pid, async { |
20 | print "starting to fetch http://www.yahoo.com/\n"; | ||
21 | get "http://www.yahoo.com/"; | ||
22 | print "fetched http://www.yahoo.com/\n"; | ||
23 | }; | ||
24 | } | ||
25 | root | 1.1 | |
26 | root | 1.6 | $_->join for @pid; |
27 | root | 1.1 |