From 4fa29d867ae79c14f5e93abea8c709b0fce3bac6 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 16 May 2017 21:48:28 +0300 Subject: [PATCH] uasyncio.core: Remove call_at() which takes absolute second time. uasyncio uses different timebase than CPython's asyncio, so absolute time scheduling compatible with it is impossible. Instead, there's call_at_() which schedules using modular millisecond time. --- uasyncio.core/uasyncio/core.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/uasyncio.core/uasyncio/core.py b/uasyncio.core/uasyncio/core.py index d3dc8996..6ba8af43 100644 --- a/uasyncio.core/uasyncio/core.py +++ b/uasyncio.core/uasyncio/core.py @@ -29,19 +29,14 @@ class EventLoop: # CPython asyncio incompatibility: we don't return Task object def call_soon(self, callback, *args): - self.call_at(self.time(), callback, *args) + self.call_at_(self.time(), callback, *args) def call_later(self, delay, callback, *args): - self.call_at(time.ticks_add(self.time(), int(delay * 1000)), callback, *args) + self.call_at_(time.ticks_add(self.time(), int(delay * 1000)), callback, *args) def call_later_ms(self, delay, callback, args=()): self.call_at_(time.ticks_add(self.time(), delay), callback, args) - def call_at(self, time, callback, *args): - if __debug__ and DEBUG: - log.debug("Scheduling %s", (time, callback, args)) - self.q.push(time, callback, args) - def call_at_(self, time, callback, args=()): if __debug__ and DEBUG: log.debug("Scheduling %s", (time, callback, args))