threads
我有一个使用HTTP::Async
多个出站 IP 地址的 Perl 代码 >>
use threads ( 'yield',
'exit' => 'threads_only',
'stack_size' => 2*16384 );
use strict;
use warnings;
no warnings 'threads';
use threads::shared;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Async;
...
my $async = HTTP::Async->new( ... );
...
foreach (@list) {
$thread = threads->create( sub {
local $SIG{KILL} = sub { threads->exit };
...
$ua->local_address($ip);
$request->url($url);
$async->add($request);
while ($response = $async->wait_for_next_response) {
...
}
}, $_);
}
...
我需要生成一些包含url和出站 IP信息的基本应用程序日志。
如何记录HTTP::Async
通信?