Forget all tracked tasks without cancelling or awaiting them. In-flight tasks
keep running; a subsequent wait will not include them.
清除所有已登记的任务,不会取消或等待它们。在途任务会继续运行;之后调用 wait 不会包含它们。
Whether there are any in-flight tasks.
是否存在在途任务。
Run a task and record it as in-flight. The task starts immediately and runs concurrently with any other in-flight tasks.
启动并登记一个任务。任务立即开始执行,与其他在途任务并发运行。
Wait for all tasks that are in-flight when this method is called to settle. Tasks started afterwards are not included (snapshot semantics). Resolves even if some of the tracked tasks reject.
等待调用本方法时所有在途的任务落定。 之后新启动的任务不会被包含(快照语义)。即使部分任务拒绝也会正常 resolve。
A tracker for promise tasks.
A task tracker records in-flight promise tasks and can wait for them to settle. It is NOT a mutual-exclusion lock: tasks submitted via
runalways execute concurrently, andrunnever queues or serializes them.一个 promise 任务追踪器。
追踪器登记在途的 promise 任务,并可等待它们全部落定。 它不是互斥锁:通过
run提交的任务始终并发执行,run不会排队或串行化任务。