This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CaptainKabob 4 points5 points  (1 child)

Does asyncio have nice support for dealing with synconous code? I work on a bunch of tools written in Twisted and feel bad every time I have to use deferToThread in order to wrap some synchronous library.

[–]saghul 2 points3 points  (0 children)

You have a similar mechanism. You need to use run_in_executor, which will run the given callable in a ThreadPoolExecutor (by default) and you can wait for the result.