Commit 1cc58a0c authored by Denis Bilenko's avatar Denis Bilenko

Pool: remove spawn_async() method since it does not work well (confuses join() and kill())

parent 24bae410
......@@ -203,8 +203,6 @@ class Pool(GreenletSet):
self._semaphore = DummySemaphore()
else:
self._semaphore = Semaphore(size)
self._semaphore.rawlink(self._on_available)
self._waiting = []
def wait_available(self):
self._semaphore.wait()
......@@ -236,20 +234,6 @@ class Pool(GreenletSet):
raise
return greenlet
def _on_available(self, _semaphore):
if self._waiting:
if _semaphore.acquire(blocking=False):
greenlet = self._waiting.pop()
self.start(greenlet)
def spawn_async(self, *args, **kwargs):
greenlet = self.greenlet_class(*args, **kwargs)
if self.full():
self._waiting.append(greenlet)
else:
greenlet.start()
return greenlet
def spawn_link(self, *args, **kwargs):
self._semaphore.acquire()
try:
......
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