Future interruption (raise, cancel) doesn't propagate through `collect`
未关闭
- 主要语言
- C++
- 星标
- 30.5k
- 派生
- 5.9k
- PR 合并指标
- 30 天内没有已合并 PR
描述
One would expect that interrupting the future resulting from `collect` would interrupt all the source futures, but this doesn't happen.
This prints 0, not 2:
```
int n = 0;
auto [p1, f1] = folly::makePromiseContract();
p1.setInterruptHandler([&](const folly::exception_wrapper& ew) { ++n; });
auto [p2, f2] = folly::makePromiseContract();
p2.setInterruptHandler([&](const folly::exception_wrapper& ew) { ++n; });
auto f = folly::collect(std::move(f1), std::move(f2));
f.cancel();
printf("%d\n", n);
```
Is there a better way to accomplish this?
贡献指南
评估
这个 Issue 还没有评估数据。