Skip to content

Instantly share code, notes, and snippets.

@shauns
Created November 8, 2014 09:47
Show Gist options
  • Save shauns/0571b75ae0098517fb92 to your computer and use it in GitHub Desktop.
Save shauns/0571b75ae0098517fb92 to your computer and use it in GitHub Desktop.
Asyncio example
@asyncio.coroutine
def slow_method():
yield from perform_a_blocking_call()
return 'Done'
loop = asyncio.get_event_loop()
loop.run_until_complete(slow_method())
loop.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment