kopia lustrzana https://github.com/micropython/micropython-lib
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
rodzic
ad73ee3043
commit
4fa29d867a
|
@ -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))
|
||||
|
|
Ładowanie…
Reference in New Issue