I'm curious. Why HTTP::Async? While it does look to make async calls, I have to admit that I've never seen it before. Not that, by itself, that's a good reason, of course :-) I would have expected the natural method for moving HTTP requests to be asynchronous to be threads. And then there's the new fad going around of using Coro (which I only started using within the last couple months). If you check that link, you'll see I'm actually using AnyEvent::HTTP to do the async HTTP requests (and then doing funny things with them to invert the control back away from call-backs).

Of course, this necessitates that you adjust (somewhat) to using a different model for your development, whether that be threading (and the fun parts of sharing variables such that they work), or event-based programming in general, or Coro (usually with events). However, the big plus to all of these options, in my opinion, is that they scale - they are methods of development that work well for many things, including, but not limited to, asynchronous HTTP requests. You can do lots of things asynchronously (I'm also doing DB fetch/store asynchronously thanks to Coro::DBI), all with the same mindset. HTTP::Async looks neat, but what you learn from using it won't be directly useful in other situations. And, while I expect HTTP::Async to likely work in a single thread (i.e., a single thread that queues a bunch of requests), it may not mix with Coro or AnyEvent very well.

Don't change just because I say so (I'm just some random schmo on the internet whose real name you don't know, and, even if you did, it would be meaningless, I'm no merlyn or chromatic or any other author that hangs out here from time to time). I'm just suggesting these as useful additions going forward if you need more async stuff.


In reply to Re: Async HTTP Request by Tanktalus
in thread Async HTTP Request by DeliriumNZ

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.