Skip to content

Instantly share code, notes, and snippets.

@itdaniher
Created November 30, 2017 21:17
Show Gist options
  • Save itdaniher/8a4890bfd3ea6ffb1e3418a563effc77 to your computer and use it in GitHub Desktop.
Save itdaniher/8a4890bfd3ea6ffb1e3418a563effc77 to your computer and use it in GitHub Desktop.
async_wrapper.py
import concurrent.futures
async def async_wrapper(loop, functional, args=(None)):
with concurrent.futures.ThreadPoolExecutor() as executor:
return await loop.run_in_executor(executor, functional, args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment