Fixed Executor.map() being greedy

This commit is contained in:
Alex Grönholm 2015-05-03 09:29:08 +03:00
parent bf5eaa018a
commit fdbc9c31a0
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
3.0.1
=====
- Made Executor.map() non-greedy
3.0.0
=====

View File

@ -4,6 +4,7 @@
import collections
import logging
import threading
import itertools
import time
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
@ -567,7 +568,7 @@ class Executor(object):
if timeout is not None:
end_time = timeout + time.time()
fs = [self.submit(fn, *args) for args in zip(*iterables)]
fs = [self.submit(fn, *args) for args in itertools.izip(*iterables)]
# Yield must be hidden in closure so that the futures are submitted
# before the first iterator value is required.