@@ -1980,14 +1980,12 @@ def _run_once(self):
1980
1980
handle ._scheduled = False
1981
1981
1982
1982
timeout = None
1983
- ready = self ._ready
1984
- scheduled = self ._scheduled
1985
1983
1986
- if ready or self ._stopping :
1984
+ if self . _ready or self ._stopping :
1987
1985
timeout = 0
1988
- elif scheduled :
1986
+ elif self . _scheduled :
1989
1987
# Compute the desired timeout.
1990
- timeout = scheduled [0 ][0 ] - self .time ()
1988
+ timeout = self . _scheduled [0 ][0 ] - self .time ()
1991
1989
if timeout > MAXIMUM_SELECT_TIMEOUT :
1992
1990
timeout = MAXIMUM_SELECT_TIMEOUT
1993
1991
elif timeout < 0 :
@@ -2000,21 +1998,20 @@ def _run_once(self):
2000
1998
2001
1999
# Handle 'later' callbacks that are ready.
2002
2000
end_time = self .time () + self ._clock_resolution
2003
- while scheduled and scheduled [0 ][0 ] < end_time :
2004
- _ , handle = heapq .heappop (scheduled )
2001
+ while self . _scheduled and self . _scheduled [0 ][0 ] < end_time :
2002
+ _ , handle = heapq .heappop (self . _scheduled )
2005
2003
handle ._scheduled = False
2006
- ready .append (handle )
2004
+ self . _ready .append (handle )
2007
2005
2008
2006
# This is the only place where callbacks are actually *called*.
2009
2007
# All other places just add them to ready.
2010
2008
# Note: We run all curren
8BF5
tly scheduled callbacks, but not any
2011
2009
# callbacks scheduled by callbacks run this time around --
2012
2010
# they will be run the next time (after another I/O poll).
2013
2011
# Use an idiom that is thread-safe without using locks.
2014
- ntodo = len (ready )
2015
- ready_popleft = ready .popleft
2012
+ ntodo = len (self ._ready )
2016
2013
for i in range (ntodo ):
2017
- handle = ready_popleft ()
2014
+ handle = self . _ready . popleft ()
2018
2015
if handle ._cancelled :
2019
2016
continue
2020
2017
if self ._debug :
0 commit comments