Generic Structure

ThrowingTaskGroup

A group that contains throwing, dynamically created child tasks.

Declaration 宣言

@frozen struct ThrowingTaskGroup<ChildTaskResult, Failure> where ChildTaskResult : Sendable, Failure : Error

Overview 概要

To create a throwing task group, call the withThrowingTaskGroup(of:returning:body:) method.

Don’t use a task group from outside the task where you created it. In most cases, the Swift type system prevents a task group from escaping like that because adding a child task to a task group is a mutating operation, and mutation operations can’t be performed from concurrent execution contexts like a child task.

For information about the language-level concurrency model that ThrowingTaskGroup is part of, see Concurrency in The Swift Programming Language.

Topics 話題

Adding Tasks to a Throwing Task Group タスクそれらをあるスローするタスクグループに加える

Accessing Individual Results 個々の結果にアクセスする

Accessing an Asynchronous Sequence of Results 結果それらからなるある非同期シーケンスにアクセスする

Canceling Tasks タスクの取り消し

Supporting Types 支援を行う型

Deprecated 非推奨

Relationships 関係

Conforms To 次に準拠

See Also 参照

Tasks さまざまなタスク