📜  异步、等待、python 代码示例

📅  最后修改于: 2022-03-11 14:47:23.093000             🧑  作者: Mango

代码示例1
async def get_chat_id(name):
    await asyncio.sleep(3)
    return "chat-%s" % name

async def main():
    id_coroutine = get_chat_id("django")
    result = await id_coroutine