use HTTP::Async; use LWP::UserAgent; my $async = HTTP::Async->new; for($idx=0; $idx<10; $idx++){ $async->add( HTTP::Request->new( GET => 'http://www.daum.com/' ) ); $async->add( HTTP::Request->new( GET => 'http://www.google.com/' ) ); } while ( my $response = $async->wait_for_next_response ) { # Do some processing with $response my $comple = $async->to_return_count; my $total = $async->total_count; my $progress = $async->in_progress_count; print "complete: $comple, total:$total, progress:$progress \n"; }
Culture, IT, Trend, Travel , Experience korea travel & culture youtube: https://www.youtube.com/@kawadakr
2015. 3. 6.
perl HTTP:Async call sample
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기