Created
September 28, 2016 01:42
-
-
Save mattrasband/62d92e6c53c549b3075695566a60c1ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
@asyncio.coroutine | |
def first_async_function(): | |
yield from asyncio.sleep(2.5) | |
return 'Result found!' | |
async def new_async_function(): | |
res = await first_async_function() | |
print('result from other async function:', res) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(new_async_function()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment