Functional Requirements
In the development of Swift's new structured parallel model, proposed the concepts of task group (TaskGroup) and asynchronous sequence (AsyncSequence). Sometimes, for reasons of brevity and efficiency, we need to convert the results of a TaskGroup into an asynchronous sequence.
As shown in the image above, we tried to convert the result of the task group into an asynchronous sequence, but failed miserably.
So, in the end, can we get what we want? In this blog post, you will learn the following:
Article directory
- Functional Requirements
- Functional Analysis
-
- 1. Why is it inefficient to wait for the result of the task group?
- 2. Several failed conversion schemes
- 3. The first method of converting to an asynchronous sequence
- 4. The second method of converting to an asynchronous sequence
- 5. Efficiency improvement brought about by converting task group results into asynchronous sequences
- 6. How to cancel the execution of task group
- 7. How to limit the subtasks executed concurrently by a task group