File tree 3 files changed +11
-0
lines changed
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):
873
873
self .loop .run_until_complete (fut )
874
874
self .assertEqual (handle .when (), when )
875
875
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
+
876
882
877
883
class TestBaseAIO (_TestBase , AIOTestCase ):
878
884
pass
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ from typing import (
7
7
Any ,
8
8
Awaitable ,
9
9
Callable ,
10
+ Deque ,
10
11
Dict ,
11
12
Generator ,
12
13
List ,
@@ -292,3 +293,4 @@ class Loop:
292
293
* ,
293
294
fallback : bool = ...
294
295
) -> 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:
3220
3220
except Exception as ex:
3221
3221
self .call_soon_threadsafe(future.set_exception, ex)
3222
3222
3223
+ # Allow external access to the ready queue for advanced scheduling and introspection
3224
+ def get_ready_queue (self ):
3225
+ return self ._ready
3223
3226
3224
3227
# Expose pointer for integration with other C-extensions
3225
3228
def libuv_get_loop_t_ptr (loop ):
You can’t perform that action at this time.
0 commit comments