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

Comparing Coro/eg/lwp (file contents):
Revision 1.5 by root, Sun Nov 5 02:18:06 2006 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
10async { 11my @pids;
11 print "hi2\n";
12 get "http://www.google.de/";
13 print "ho2\n";
14};
15 12
16async { 13for (1..1) {
17 print "hi\n"; 14 push @pid, async {
15 print "starting to fetch http://www.google.de/\n";
18 get "http://www.yahoo.com/"; 16 get "http://www.google.de/";
19 print "ho\n"; 17 print "fetched http://www.google.de/\n";
18 };
20 19
21}; 20 push @pid, async {
21 print "starting to fetch http://www.yahoo.com/\n";
22 get "http://www.yahoo.com/";
23 print "fetched http://www.yahoo.com/\n";
24 };
25}
22 26
23loop; 27$_->join for @pid;
24 28

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines