Commits

Evgeniy Tatarkin  committed 7074e22

urllib and twisted downloader on get method yield result

  • Participants
  • Parent commits 639a24d

Comments (0)

Files changed (3)

 
 Not released yet
 
+- urllib and twidted downloader on get method yield result
 - bugfix `depth first` method
 - concurrenttools change try/finally to generator behavior
 - processing requests through queue

File pomp/contrib/twistedtools.py

         self.timeout = timeout
 
     def get(self, requests):
-        responses = []
         for request in iterator(requests):
-            response = self._fetch(request)
-            responses.append(response)
-        return responses
+            yield self._fetch(request)
 
     def _fetch(self, request):
         d = self.agent.request(

File pomp/contrib/urllibtools.py

         self.timeout = timeout
 
     def get(self, requests):
-        responses = []
         for request in iterator(requests):
-            response = self._fetch(request)
-            responses.append(response)
-        return responses
+            yield self._fetch(request)
 
     def _fetch(self, request):
         try: