File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -862,9 +862,10 @@ The `TaskGroup` class is unofficially provided by
862
862
suited to applications where one or more of a group of tasks is subject to
863
863
runtime exceptions. A ` TaskGroup ` is instantiated in an asynchronous context
864
864
manager. The ` TaskGroup ` instantiates member tasks. When all have run to
865
- completion, the context manager terminates. Return values from member tasks
866
- cannot be retrieved. Results should be passed in other ways such as via bound
867
- variables, queues etc.
865
+ completion, the context manager terminates. Where ` gather ` is static, a task
866
+ group can be dynamic: a task in a group may spawn further group members. Return
867
+ values from member tasks cannot be retrieved. Results should be passed in other
868
+ ways such as via bound variables, queues etc.
868
869
869
870
An exception in a member task not trapped by that task is propagated to the
870
871
task that created the ` TaskGroup ` . All tasks in the ` TaskGroup ` then terminate
@@ -922,6 +923,9 @@ async def main():
922
923
923
924
asyncio.run(main())
924
925
```
926
+ [ This doc] ( https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ )
927
+ provides background on the theory behind task groups and how they can improve
928
+ program structure and reliablity.
925
929
926
930
###### [ Contents] ( ./TUTORIAL.md#contents )
927
931
You can’t perform that action at this time.
0 commit comments