ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/eg/lwp
(Generate patch)

Comparing Coro/eg/lwp (file contents):
Revision 1.6 by root, Sat Apr 14 15:06:06 2007 UTC vs.
Revision 1.8 by root, Mon Nov 24 04:56:38 2008 UTC

1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3use Coro; 3use Coro;
4use Coro::Event; 4use Coro::AnyEvent;
5use Coro::LWP; # should be use'd as early as possible 5use Coro::LWP; # should be use'd as early as possible
6use LWP::Simple; 6use LWP::Simple;
7 7
8$SIG{PIPE} = 'IGNORE'; 8$SIG{PIPE} = 'IGNORE';
9 9
10my @pids; 10my @pids;
11 11
12for (1..1) {
12push @pid, async { 13 push @pid, async {
13 print "starting to fetch http://www.google.de/\n"; 14 print "starting to fetch http://www.google.de/\n";
14 get "http://www.google.de/"; 15 get "http://www.google.de/";
15 print "fetched http://www.google.de/\n"; 16 print "fetched http://www.google.de/\n";
16}; 17 };
17 18
18push @pid, async { 19 push @pid, async {
19 print "starting to fetch http://www.yahoo.com/\n"; 20 print "starting to fetch http://www.yahoo.com/\n";
20 get "http://www.yahoo.com/"; 21 get "http://www.yahoo.com/";
21 print "fetched http://www.yahoo.com/\n"; 22 print "fetched http://www.yahoo.com/\n";
22}; 23 };
24}
23 25
24$_->join for @pid; 26$_->join for @pid;
25 27

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines