AnyEvent-Net-Curl-Queued
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
common_opts
"opts" in AnyEvent::Net::Curl::Queued::Easy attribute common to all
workers initialized under the same queue. You may define User-Agent
string here.
http_response
Encapsulate the response with HTTP::Response (only when the scheme is
HTTP/HTTPS); a global version of "http_response" in
AnyEvent::Net::Curl::Queued::Easy. Default: disabled.
completed
Count completed requests.
cv
AnyEvent condition variable. Initialized automatically, unless you
specify your own. Also reset automatically after "wait", so keep your
own reference if you really need it!
max
Maximum number of parallel connections (default: 4; minimum value: 1).
multi
Net::Curl::Multi instance.
queue
ArrayRef to the queue. Has the following helper methods:
queue_push
Append item at the end of the queue.
queue_unshift
Prepend item at the top of the queue.
dequeue
Shift item from the top of the queue.
count
Number of items in queue.
share
Net::Curl::Share instance.
stats
AnyEvent::Net::Curl::Queued::Stats instance.
timeout
Timeout (default: 60 seconds).
unique
Signature cache.
watchdog
The last resort against the non-deterministic chaos of evil lurking
sockets.
METHODS
inc_completed
Increment the "completed" counter.
start()
Populate empty request slots with workers from the queue.
empty()
Check if there are active requests or requests in queue.
add($worker)
Activate a worker.
append($worker)
Put the worker (instance of AnyEvent::Net::Curl::Queued::Easy) at the
end of the queue. For lazy initialization, wrap the worker in a sub {
... }, the same way you do with the Moo default => sub { ... }:
$queue->append(sub {
AnyEvent::Net::Curl::Queued::Easy->new({ initial_url => 'http://.../' })
});
prepend($worker)
Put the worker (instance of AnyEvent::Net::Curl::Queued::Easy) at the
beginning of the queue. For lazy initialization, wrap the worker in a
sub { ... }, the same way you do with the Moo default => sub { ... }:
$queue->prepend(sub {
AnyEvent::Net::Curl::Queued::Easy->new({ initial_url => 'http://.../' })
});
wait()
Process queue.
CAVEAT
* Many sources suggest to compile libcurl <http://curl.haxx.se/> with
c-ares <http://c-ares.haxx.se/> support. This only improves
performance if you are supposed to do many DNS resolutions (e.g.
access many hosts). If you are fetching many documents from a single
server, c-ares initialization will actually slow down the whole
process!
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.558 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )