Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Async-Sync

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:
ADD COMMENT
Topic
Name
3+5 =