[Twisted-Python] Something like a ThreadPool

Itamar Shtull-Trauring itamar at itamarst.org
Wed Jun 18 07:25:33 EDT 2008


On Wed, 2008-06-18 at 04:13 -0400, kevin beckford wrote:
> Is there any sort of job queue or similar ,  besides AsynQueue, which
> looked like exactly what i wanted, but is sadly undocumented,   native
> to twisted?  What is the twisted way to do such a thing?  Is there
> something already available?

What kind of work are you queuing? If it's e.g. fetching a web page, you
can just use do it using Twisted's scalable asynchronous APIs (maybe
using a DeferredSemaphore if you want to limit number of conccurent
queries.) If it's a blocking API you're calling (RDBMS queries are the
typical example) then Twisted has a thread pool, as  well as
RDBMS-specific wrapper - see our documentation.





More information about the Twisted-Python mailing list