Commit ee7d278c authored by Denis Bilenko's avatar Denis Bilenko

add wait_available() to Pool and GreenletSet

parent 199795e4
...@@ -181,6 +181,9 @@ class GreenletSet(object): ...@@ -181,6 +181,9 @@ class GreenletSet(object):
def full(self): def full(self):
return False return False
def wait_available(self):
pass
class Pool(GreenletSet): class Pool(GreenletSet):
...@@ -194,6 +197,9 @@ class Pool(GreenletSet): ...@@ -194,6 +197,9 @@ class Pool(GreenletSet):
self._available_event = Event() self._available_event = Event()
self._available_event.set() self._available_event.set()
def wait_available(self):
self._available_event.wait()
def full(self): def full(self):
return self.free_count() <= 0 return self.free_count() <= 0
......
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