_asyncio -- Asynchronous I/O scheduler for writing concurrent code. =================================================================== .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/_asyncio/__init__.pyi .. py:module:: _asyncio .. autoapi-nested-parse:: Asynchronous I/O scheduler for writing concurrent code. CPython module: `asyncio` Example:: import asyncio async def blink(led, period_ms): while True: led.on() await asyncio.sleep_ms(5) led.off() await asyncio.sleep_ms(period_ms) async def main(led1, led2): asyncio.create_task(blink(led1, 700)) asyncio.create_task(blink(led2, 400)) await asyncio.sleep_ms(10_000) # Running on a pyboard from pyb import LED asyncio.run(main(LED(1), LED(2))) # Running on a generic board from machine import Pin asyncio.run(main(Pin(1), Pin(2))) Classes ------- .. autoapisummary:: _asyncio.Task _asyncio.TaskQueue Module Contents --------------- .. py:class:: Task This object wraps a coroutine into a running task. Tasks can be waited on using ``await task``, which will wait for the task to complete and return the return value of the task. Tasks should not be created directly, rather use `create_task` to create them. .. py:class:: TaskQueue(*argv, **kwargs) .. py:method:: peek(*args, **kwargs) -> _typeshed.Incomplete .. py:method:: pop(*args, **kwargs) -> _typeshed.Incomplete .. py:method:: push(*args, **kwargs) -> _typeshed.Incomplete .. py:method:: remove(*args, **kwargs) -> _typeshed.Incomplete