Async/Concurrent HTTP Requests

Paul Rubin no.email at nospam.invalid
Thu Feb 12 13:15:21 EST 2015


Ari King <ari.brandeis.king at gmail.com> writes:
> I'd like to query two (or more) RESTful APIs concurrently. What is the
> pythonic way of doing so? Is it better to use built in functions or
> are third-party packages? Thanks.

The two basic approaches are event-based asynchronous i/o (there are
various packages for that) and threads.  There are holy wars over which
is better.  Event-driven i/o in Python 2.x was generally done with
callback-based packages like Twisted Matrix (www.twistedmatrix.com).  In
Python 3 there are some nicer mechanisms (coroutines) so the new asyncio
package may be easier to use than Twisted.  I haven't tried it yet.



More information about the Python-list mailing list