def joinall(greenlets, timeout=None, raise_error=False, count=None): if not raise_error: wait(greenlets, timeout=timeout, count=count) else: for obj in iwait(greenlets, timeout=timeout, count=count): if getattr(obj, 'exception', None) is not None: if hasattr(obj, '_raise_exception'): obj._raise_exception() else: raise obj.exception
def joinall(greenlets, timeout=None, raise_error=False, count=None): if not raise_error: wait(greenlets, timeout=timeout) else: for obj in iwait(greenlets, timeout=timeout): if getattr(obj, 'exception', None) is not None: raise obj.exception if count is not None: count -= 1 if count <= 0: break
def joinall(greenlets, timeout=None, raise_error=False, count=None): if not raise_error: wait(greenlets, timeout=timeout) for green in greenlets: if hasattr(green, "_exc_info"): del green._exc_info else: for obj in iwait(greenlets, timeout=timeout): if getattr(obj, 'exception', None) is not None: obj.raise_exception() if count is not None: count -= 1 if count <= 0: break
def joinall(greenlets, timeout=None, raise_error=False, count=None): """ Wait for the ``greenlets`` to finish. :param greenlets: A sequence (supporting :func:`len`) of greenlets to wait for. :keyword float timeout: If given, the maximum number of seconds to wait. :return: A sequence of the greenlets that finished before the timeout (if any) expired. """ if not raise_error: return wait(greenlets, timeout=timeout, count=count) done = [] for obj in iwait(greenlets, timeout=timeout, count=count): if getattr(obj, 'exception', None) is not None: if hasattr(obj, '_raise_exception'): obj._raise_exception() else: raise obj.exception done.append(obj) return done