简体   繁体   English

如何知道组中的最后一次异步调用何时完成?

[英]How can I know when the last async call in a group is completed?

If I'm running a series of async Tasks in C#, is there a reliable way for me to know when the last of the set has completed? 如果我在C#中运行一系列async Tasks ,是否有可靠的方法让我知道最后一个集合何时完成?

Note: The number of Tasks I'm creating is not known ahead of time, so I'll only know when I'm done creating them after an external condition is satisfied. 注意:我正在创建的Tasks数量未提前知道,因此我只知道在满足外部条件后何时完成创建它们。

Task.WhenAll(IEnumerable<Task>)创建一个任务,该任务在参数列表中的所有任务完成时完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM