--- Python-3.5.0/Lib/asyncio/base_events.py 2015-09-13 05:41:20.000000000 -0600 +++ ../project/py35stdlib/asyncio/base_events.py 2015-11-11 20:32:32.000000000 -0700 @@ -1106,6 +1106,7 @@ schedules the resulting callbacks, and finally schedules 'call_later' callbacks. """ + self._run_ready() sched_count = len(self._scheduled) if (sched_count > _MIN_SCHEDULED_TIMER_HANDLES and @@ -1171,13 +1172,15 @@ handle = heapq.heappop(self._scheduled) handle._scheduled = False self._ready.append(handle) + self._run_ready() - # This is the only place where callbacks are actually *called*. - # All other places just add them to ready. - # Note: We run all currently scheduled callbacks, but not any - # callbacks scheduled by callbacks run this time around -- - # they will be run the next time (after another I/O poll). - # Use an idiom that is thread-safe without using locks. + def _run_ready(self): + """ This is the only place where callbacks are actually *called*. + All other places just add them to ready. + Note: We run all currently scheduled callbacks, but not any + callbacks scheduled by callbacks run this time around -- + they will be run the next time (after another I/O poll). + Use an idiom that is thread-safe without using locks. """ ntodo = len(self._ready) for i in range(ntodo): handle = self._ready.popleft()