… | |
… | |
5 | use Coro::LWP; # should be use'd as early as possible |
5 | use Coro::LWP; # should be use'd as early as possible |
6 | use LWP::Simple; |
6 | use LWP::Simple; |
7 | |
7 | |
8 | $SIG{PIPE} = 'IGNORE'; |
8 | $SIG{PIPE} = 'IGNORE'; |
9 | |
9 | |
10 | async { |
10 | my @pids; |
11 | print "hi2\n"; |
|
|
12 | get "http://www.google.de/"; |
|
|
13 | print "ho2\n"; |
|
|
14 | }; |
|
|
15 | |
11 | |
16 | async { |
12 | for (1..1) { |
17 | print "hi\n"; |
13 | push @pid, async { |
|
|
14 | print "starting to fetch http://www.google.de/\n"; |
18 | get "http://www.yahoo.com/"; |
15 | get "http://www.google.de/"; |
19 | print "ho\n"; |
16 | print "fetched http://www.google.de/\n"; |
|
|
17 | }; |
20 | |
18 | |
21 | }; |
19 | 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 | } |
22 | |
25 | |
23 | loop; |
26 | $_->join for @pid; |
24 | |
27 | |