summaryrefslogtreecommitdiff
path: root/eventlet/greenpool.py
diff options
context:
space:
mode:
authorRyan Williams <rdw@lindenlab.com>2010-02-09 15:48:35 -0800
committerRyan Williams <rdw@lindenlab.com>2010-02-09 15:48:35 -0800
commitd0df89d182cff787c2ace94de9af5aa5dc2dcf14 (patch)
treea471a9da07fc6496da90dc6c4702c2981f632a96 /eventlet/greenpool.py
parenta45084b13b8c3fe56320d31a6ae176c344a35a8b (diff)
downloadeventlet-d0df89d182cff787c2ace94de9af5aa5dc2dcf14.tar.gz
Made termination condition of imap non-raise-y to keep log spam down.
Diffstat (limited to 'eventlet/greenpool.py')
-rw-r--r--eventlet/greenpool.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/eventlet/greenpool.py b/eventlet/greenpool.py
index f460bfa..479027e 100644
--- a/eventlet/greenpool.py
+++ b/eventlet/greenpool.py
@@ -142,7 +142,7 @@ class GreenPool(object):
def _do_map(self, func, it, gi):
for args in it:
gi.spawn(func, *args)
- gi.spawn(raise_stop_iteration)
+ gi.spawn(return_stop_iteration)
def starmap(self, function, iterable):
"""This is the same as :func:`itertools.starmap`, except that *func* is
@@ -164,8 +164,8 @@ class GreenPool(object):
return self.starmap(function, itertools.izip(*iterables))
-def raise_stop_iteration():
- raise StopIteration()
+def return_stop_iteration():
+ return StopIteration()
class GreenPile(object):
@@ -227,6 +227,10 @@ class GreenMap(GreenPile):
def next(self):
try:
- return self.waiters.get().wait()
+ val = self.waiters.get().wait()
+ if isinstance(val, StopIteration):
+ raise val
+ else:
+ return val
finally:
self.counter -= 1