Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

vincentbernat
Copy link
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
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