+ completed_futures.add(f)
+ yield smart_future_by_real_future[f]
+ if callback is not None:
+ callback()
+ return
+
+
+def wait_all(futures: List[SmartFuture]) -> None:
+ real_futures = [x.wrapped_future for x in futures]
+ (done, not_done) = concurrent.futures.wait(
+ real_futures,
+ timeout=None,
+ return_when=concurrent.futures.ALL_COMPLETED
+ )
+ assert len(done) == len(real_futures)
+ assert len(not_done) == 0