Setting the LWP::Parallel::UserAgent chunk size in the callback method

L

Leif Wessman

Hi!

I want to use LWP::parallel::UserAgent to handle each request when it
has returned.

I've tried the wait() method. The problem with the wait() method is
that I can parse each response first when all the other requests are
finished.

My second try was to use a callback function. Since I want to handle
the whole response data at the same time, I've set the chunk size to be
very large (100 MB). I was thinking that this would make each chunk to
be the whole page. However, that didn't work. Each cunk becomes about
1460 bytes anyway.

My third try was to use a callback function and put the chunks for a
certain request in a buffer. So that when the whole page is loaded, I
can parse it. However - I can't figure out how to know when the page is
fully loaded. As staded in the docs, the length($content) == 0 doesn't
mean the connection is closed.

Is the some other way to handle each request when it has returned?
Leif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,420
Latest member
ZitaVos505

Latest Threads

Top