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

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 marked this pull request as ready for review February 5, 2023 10:48
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.

None yet

1 participant