Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I can only give you general guidance, because I'm not well versed in the workings of mysql servers, but it sounds like a good bet that you can setup multiple socket connections in threads. I would first look at the POE Cookbook, it probably has a ready made example.

Otherwise you have a couple of possibilties. IO::Select and threaded. IO::Select will let you add socket filehandles then loop thru them and read them as they reply. The drawback is a huge transfer from one server, will block the others until it is finished.

An alternative, would be to have your main thread connect to the mysql server, then have it pass the socket filehandles off to a separate thread for reading. That way they won't block each other. See FileHandles and threads


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: What's the best way to fetch data from multiple sources asynchronously? by zentara
in thread What's the best way to fetch data from multiple sources asynchronously? by xaprb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-25 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found