Fixed Executor.map() being greedy
This commit is contained in:
parent
bf5eaa018a
commit
fdbc9c31a0
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue