kopia lustrzana https://github.com/micropython/micropython-lib
asyncio: Add basic loop.call_soon() test.
rodzic
179d0447f1
commit
fa273cae71
|
@ -0,0 +1,13 @@
|
|||
import asyncio
|
||||
import time
|
||||
|
||||
|
||||
def cb():
|
||||
print("callback")
|
||||
time.sleep(0.5)
|
||||
loop.call_soon(cb)
|
||||
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.call_soon(cb)
|
||||
loop.run_forever()
|
Ładowanie…
Reference in New Issue