Skip to content
New issue

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

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

Already on GitHub? # to your account

Kristjan/get ready queue #525

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kristjanvalur
Copy link

This pull request adds introspection methods to uvloop.Loop and uvloop.loop.Handle.

  • Loop.get_ready_queue() exposes the internal Deque, which is available as _ready on an asyncio loop object.
  • Handle.get_callback() returns the registered python callback and args. for asyncio this information can be gleaned from Handle._callback

This allows uvloop to work with applications which examine and manipulate the ready queue of runnable tasks, such as https://github.com/kristjanvalur/py-asynkit. A branch which uses these features is available at https://github.com/kristjanvalur/py-asynkit/tree/dev/uvloop

An alternative implementation would emulate these same internal attributes as asyncio has, but IMHO those should also be better exposed by accessor methods.

@kristjanvalur kristjanvalur force-pushed the kristjan/get_ready_queue branch from 0fd3634 to 1c76fe9 Compare February 5, 2023 10:29
@kristjanvalur kristjanvalur marked this pull request as ready for review February 5, 2023 10:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant