Commit eb70da4
committed
gh-155502: Warn about keeping a reference to tasks from loop.create_task
The low-level Event Loop documentation for create_task() did not repeat
the warning from the high-level asyncio.create_task() docs that the
event loop only keeps weak references to tasks, so a task that is not
referenced elsewhere may be garbage collected before it completes.
Mirror the note (including the fire-and-forget collection pattern) in
the loop.create_task() documentation.1 parent ee68f5f commit eb70da4
1 file changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
391 | 424 | | |
392 | 425 | | |
393 | 426 | | |
| |||
0 commit comments