Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Speeding things up -- LWP::Parallel

by marioroy (Prior)
on Apr 29, 2018 at 10:43 UTC ( [id://1213756]=note: print w/replies, xml ) Need Help??


in reply to Re: Speeding things up -- LWP::Parallel
in thread Speeding things up

Hi Discipulus,

... while i invite you to take a look to MCE unfortunately is not usefeul in this case because LWP::* modules are not thread safe ...

An event-type module is typically preferred for this use-case. However, I took a look and tracked this down. See Re: Crash with ForkManager on Windows. When running parallel using LWP::*, it is essential to load IO::Handle and a couple Net::* modules before spawning workers. The latest MCE and MCE::Shared (MCE::Hobo) updates do this automatically if present, LWP::UserAgent.

use LWP::Simple; # Pre-load essential modules for extra stability. if ( $INC{'LWP/UserAgent.pm'} && !$INC{'Net/HTTP.pm'} ) { require IO::Handle; require Net::HTTP; require Net::HTTPS; }

Regards, Mario

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1213756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found