Repository navigation
Commit eb0323d
authored
refactor: adopt asyncio.TaskGroup for structured concurrency (#909)
Adopts `asyncio.TaskGroup` (Python 3.11+) in four places:
- **`ApifyRequestList._fetch_requests_from_url`** — structured task
scope for concurrent remote-list fetches; errors aggregate as
`ExceptionGroup`.
- **`Actor.reboot` pre-reboot dispatch** — `asyncio.timeout(...)` +
`TaskGroup`, each listener wrapped in `safe_dispatch` so one failure no
longer aborts siblings (preserves
`test_reboot_runs_all_listeners_even_when_one_fails`).
- **`Actor._save_actor_state`** — per-store persists fan out instead of
running sequentially; per-task try/except keeps cleanup best-effort.
- **`ApifyFileSystemKeyValueStoreClient.purge`** — `unlink` calls fan
out instead of running sequentially.
Closes #7651 parent f4304e8 commit eb0323d
4 files changed
Lines changed: 35 additions & 25 deletions
File tree
- docs/04_upgrading
- src/apify
- request_loaders
- storage_clients/_file_system
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1231 | 1231 | | |
1232 | 1232 | | |
1233 | 1233 | | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1234 | 1241 | | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1243 | 1247 | | |
1244 | 1248 | | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
1250 | 1249 | | |
1251 | 1250 | | |
1252 | 1251 | | |
| |||
1419 | 1418 | | |
1420 | 1419 | | |
1421 | 1420 | | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1425 | 1431 | | |
1426 | 1432 | | |
1427 | 1433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
0 commit comments