Skip to content

Use a callback to to call _reaper instead of scheduling it#45

Closed
vincentbernat wants to merge 1 commit intoldo:masterfrom
vincentbernat:fix/cpu-reaper
Closed

Use a callback to to call _reaper instead of scheduling it#45
vincentbernat wants to merge 1 commit intoldo:masterfrom
vincentbernat:fix/cpu-reaper

Conversation

@vincentbernat
Copy link
Copy Markdown
Contributor

asyncio is only maintaining weak references to task. To avoid them
being destroyed while still pending, we need to keep a reference on
them. Previously, a function was scheduled at each tick to cleanup
done tasks. Instead, we add a callback to the task to cleanup its own
reference when done.

Fix #44.

asyncio is only maintaining weak references to task. To avoid them
being destroyed while still pending, we need to keep a reference on
them. Previously, a function was scheduled at each tick to cleanup
done tasks. Instead, we add a callback to the task to cleanup its own
reference when done.

Fix ldo#44.
@ldo
Copy link
Copy Markdown
Owner

ldo commented Jul 17, 2021

Dang. Wouldn’t you know asyncio already has the facilities to deal with this sort of thing.

Patch applied, and thanks.

@ldo ldo closed this Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

High CPU usage for _reaper

2 participants