[Twisted-Python] Throttling outgoing client requests
David E. Konerding
dekonerding at lbl.gov
Mon Sep 12 12:30:51 EDT 2005
I am writing a client usign Twisted that makes a lot of XMLRPC requests
simultaneously (using twisted.web.xmlrpc.Proxy). There are a bunch of
them, all to the same site,
and when I run on MacOSX, I start getting bind errors-- I think OS X
must have more restricted outgoing network connections that the linux
box I normally work on.
My goal is to throttle the number of outgoing requests. I could do this
by submitting just one request at a time, and having a deferred callback
registered such that when the request completes (successfully or not)
the next request is submitting. But this sort of code flow is pretty
contorted. My other thought would be to just schedule all the calls
with a callLater and a randomized delay for each call. Again, not so clean.
Is there a 'clean' way to throttle back the number of ongoing client
requests-- perhaps through the xmlrpc.Proxy itself, or through some pattern?
More information about the Twisted-Python