Asynchronisé
def get_chat_id(name):
time.sleep(3)
return "chat-%s" % name
async def main():
result = get_chat_id("django")
Amused Antelope
def get_chat_id(name):
time.sleep(3)
return "chat-%s" % name
async def main():
result = get_chat_id("django")
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