Skip to content

Instantly share code, notes, and snippets.

@nicksspirit
Created October 15, 2020 13:20
Show Gist options
  • Save nicksspirit/8eb26062ef833a6646268259cd361ad9 to your computer and use it in GitHub Desktop.
Save nicksspirit/8eb26062ef833a6646268259cd361ad9 to your computer and use it in GitHub Desktop.
Decorator to run an async function
def run_async(fn):
@wraps(fn)
def fn_wrapped(*args, **kwargs):
return asyncio.run(fn(*args, **kwargs))
return fn_wrapped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment