(fut: Future)
| 493 | future_set_result_unless_cancelled(future, {} if keys is not None else []) |
| 494 | |
| 495 | def callback(fut: Future) -> None: |
| 496 | unfinished_children.remove(fut) |
| 497 | if not unfinished_children: |
| 498 | result_list = [] |
| 499 | for f in children_futs: |
| 500 | try: |
| 501 | result_list.append(f.result()) |
| 502 | except Exception as e: |
| 503 | if future.done(): |
| 504 | if not isinstance(e, quiet_exceptions): |
| 505 | app_log.error( |
| 506 | "Multiple exceptions in yield list", exc_info=True |
| 507 | ) |
| 508 | else: |
| 509 | future_set_exc_info(future, sys.exc_info()) |
| 510 | if not future.done(): |
| 511 | if keys is not None: |
| 512 | future_set_result_unless_cancelled( |
| 513 | future, dict(zip(keys, result_list)) |
| 514 | ) |
| 515 | else: |
| 516 | future_set_result_unless_cancelled(future, result_list) |
| 517 | |
| 518 | listening = set() # type: Set[Future] |
| 519 | for f in children_futs: |
no test coverage detected