add method wait() to block until every backends answered

This commit is contained in:
Romain Bignon 2010-06-30 10:35:09 +02:00
commit 5344220edc

View file

@ -157,6 +157,13 @@ class BackendsCall(object):
thread.start() thread.start()
return thread return thread
def wait(self):
self.finish_event.wait()
with self.mutex:
if self.errors:
raise CallErrors(self.errors)
def __iter__(self): def __iter__(self):
# Don't know how to factorize with _callback_thread_run # Don't know how to factorize with _callback_thread_run
responses = [] responses = []