Commit e1a136cd authored by Denis Bilenko's avatar Denis Bilenko

fix Pool.kill to also kill not yet started greenlets

parent 5f7c4083
...@@ -200,6 +200,12 @@ class Pool(GreenletSet): ...@@ -200,6 +200,12 @@ class Pool(GreenletSet):
g.start(*args) g.start(*args)
self.add(g) self.add(g)
def kill(self, exception=GreenletExit, block=False, timeout=None):
for g, args in self.waiting:
g.kill(exception)
self.waiting.clear()
return GreenletSet.kill(self, exception=exception, block=block, timeout=timeout)
def get_values(greenlets): def get_values(greenlets):
joinall(greenlets) joinall(greenlets)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment