Commit e763949
committed
Add a
`asyncio.TaskGroup` is a very convenient construct when using
parallelization for doing calculations for example, where the results
for all the tasks need to be merged together to produce a final result.
In this case if one of the tasks fails, it makes sense to cancel the
others and abort as soon as possible, as any further calculations would
be thrown away.
This class is intended to help managing a group of tasks that should
persist even if other tasks in the group fail, usually by either only
discarding the failed task or by restarting it somehow.
Signed-off-by: Leandro Lucarella <[email protected]>PersistentTaskGroup class1 parent 064a707 commit e763949
File tree
3 files changed
+783
-0
lines changed- src/frequenz/core/asyncio
- tests/asyncio
3 files changed
+783
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
0 commit comments