Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

async, await, python

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
Source by www.aeracode.org #
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
7+8 =