- newly_completed_futures = concurrent.futures.as_completed(real_futures)
- for f in newly_completed_futures:
+ try:
+ newly_completed_futures = concurrent.futures.as_completed(real_futures, timeout=timeout)
+ for f in newly_completed_futures:
+ if callback is not None:
+ callback()
+ completed_futures.add(f)
+ if log_exceptions and not f.cancelled():
+ exception = f.exception()
+ if exception is not None:
+ logger.warning(
+ 'Future 0x%x raised an unhandled exception and exited.', id(f)
+ )
+ logger.exception(exception)
+ raise exception
+ yield smart_future_by_real_future[f]
+ except TimeoutError: