Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: AnyEvent Parallel HTTP

by Yary (Pilgrim)
on Feb 19, 2015 at 20:00 UTC ( [id://1117259]=note: print w/replies, xml ) Need Help??


in reply to AnyEvent Parallel HTTP

AnyEvent is awesome, but it doesn't fork or thread. It's for co-operative event handling within a single process. You should look at MCE, Parallel::Async, IPC::Fork::Simple, Parallel::ForkManager, Thread::Pool::Simple- something like that, which actually opens a new process or thread to do work in parallel (perhaps on separate CPUs, if you have them)

EDIT Or look more at AnyEvent's docs to see how it can be made to fork or thread using any of these: AnyEvent::Fork, AnyEvent::Fork::RPC, AnyEvent::Fork::Pool, AnyEvent::Fork::Remote, Coro::AnyEvent

Replies are listed 'Best First'.
Re^2: AnyEvent Parallel HTTP
by Corion (Patriarch) on Feb 21, 2015 at 16:46 UTC

    Uh - AnyEvent is a framework to do tasks in parallel that are not CPU bound. And usually, web scraping is not CPU bound. Distributing the load across more than one CPU makes sense if your load is CPU bound, but not necessarily when scraping a website over the network.

    There is no need to involve threads or forking when using AnyEvent.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found