uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

Kristjan/get ready queue

Open kristjanvalur opened this issue 2 years ago • 0 comments

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 avatar Feb 05 '23 10:02 kristjanvalur

If you want to check out the source code, I believe it's in the repo under example/src. There is a useDocsActions hook that might prove helpful

npfitz avatar Apr 15 '24 16:04 npfitz

Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 14 '24 19:08 stale[bot]