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.9 by root, Mon Nov 24 07:55:28 2008 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines