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.
pull/68/merge
Paul Sokolovsky 2017-05-16 21:48:28 +03:00
rodzic ad73ee3043
commit 4fa29d867a
1 zmienionych plików z 2 dodań i 7 usunięć

Wyświetl plik

@ -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))