Created
November 30, 2017 21:17
-
-
Save itdaniher/8a4890bfd3ea6ffb1e3418a563effc77 to your computer and use it in GitHub Desktop.
async_wrapper.py
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 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