kopia lustrzana https://github.com/micropython/micropython-lib
uasyncio.core: Implement EventLoop.create_task(), new method in Python 3.4.2.
This method allows to schedule a coroutine in a loop without confusing globals like async() or Task().pull/11/head
rodzic
e9c7fa43f4
commit
acbc5e462f
|
@ -16,6 +16,11 @@ class EventLoop:
|
|||
def time(self):
|
||||
return time.time()
|
||||
|
||||
def create_task(self, coro):
|
||||
# CPython 3.4.2
|
||||
self.call_at(0, callback)
|
||||
# CPython asyncio incompatibility: we don't return Task object
|
||||
|
||||
def call_soon(self, callback, *args):
|
||||
self.call_at(0, callback, *args)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue