File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -873,6 +873,12 @@ def test_loop_call_later_handle_when_after_fired(self):
873873 self .loop .run_until_complete (fut )
874874 self .assertEqual (handle .when (), when )
875875
876+ def test_get_ready_queue (self ):
877+ l1 = len (self .loop .get_ready_queue ())
878+ self .loop .call_soon (lambda : None )
879+ l2 = len (self .loop .get_ready_queue ())
880+ self .assertEqual (l1 , l2 - 1 )
881+
876882
877883class TestBaseAIO (_TestBase , AIOTestCase ):
878884 pass
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ from typing import (
77 Any ,
88 Awaitable ,
99 Callable ,
10+ Deque ,
1011 Dict ,
1112 Generator ,
1213 List ,
@@ -292,3 +293,4 @@ class Loop:
292293 * ,
293294 fallback : bool = ...
294295 ) -> int : ...
296+ def get_ready_queue (self ) -> Deque [asyncio .Handle ]: ...
Original file line number Diff line number Diff line change @@ -3220,6 +3220,9 @@ cdef class Loop:
32203220 except Exception as ex:
32213221 self .call_soon_threadsafe(future.set_exception, ex)
32223222
3223+ # Allow external access to the ready queue for advanced scheduling and introspection
3224+ def get_ready_queue (self ):
3225+ return self ._ready
32233226
32243227# Expose pointer for integration with other C-extensions
32253228def libuv_get_loop_t_ptr (loop ):
You can’t perform that action at this time.
0 commit comments