Manlio Perillo ha scritto: > [...] > Here is a quick example, ABSOLUTELY NOT TESTED: > > class DownloadQueue(object): > SIZE = 50 > > def init(self): > self.requests = [] # queued requests > self.deferreds = [] # waiting requests > > def addRequest(self, url, timeout): > if len(self.deferreds) >= sels.SIZE: > # wait for completion of all previous requests > DeferredList(self.deferreds > ).addCallback(self._callback) > self.deferreds = []
The deferreds list should be cleared in the _callback method, not here. Please note that probably there are other bugs. Regards Manlio Perillo -- http://mail.python.org/mailman/listinfo/python-list