Scheduling algorithm: Suggestions?

Allen Fowler allen.fowler at yahoo.com
Tue Sep 8 00:10:24 CEST 2009


Hello,

I have a batch of "rpc style" calls that I must make to an external server via HTTP in a multi threaded fashion.  (Return vales must be saved.)   Problem is, I need to throttle the rate at which I do this.

Each HTTP call takes between 0.2 and several seconds to complete.

I need to control two different aspects:

1) Number of new connections per second.
2) Total number of parallel connections allowed.

Additionally, it is possible that an HTTP call could result in an error at the remote server.  If so, it must be retried couple of times before an error is logged.

Does anybody have a suggestions as to the correct way to implement such a system in Python?

Thank you,
:)


      



More information about the Python-list mailing list