X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/35ade8a042094a27e2ca5cfd5e9754aa3513410c..788ecdf8085f5e69cd3dc960f510b49f11432cb3:/sdk/python/arvados/events.py diff --git a/sdk/python/arvados/events.py b/sdk/python/arvados/events.py index e6038fcd7d..d1abc0f7de 100644 --- a/sdk/python/arvados/events.py +++ b/sdk/python/arvados/events.py @@ -78,9 +78,19 @@ class PollClient(threading.Thread): self.id = max_id self.stop.wait(self.poll_time) + def run_forever(self): + self.stop.wait() + def close(self): self.stop.set() - self.join() + try: + self.join() + except RuntimeError: + # "join() raises a RuntimeError if an attempt is made to join the + # current thread as that would cause a deadlock. It is also an + # error to join() a thread before it has been started and attempts + # to do so raises the same exception." + pass def subscribe(self, filters): self.on_event({'status': 200})