This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author txomon
Recipients gvanrossum, txomon, yselivanov
Date 2017-02-14.17:16:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The current architecture of asyncio makes it really hard to combine both async and sync code.

When porting a Thread based application to asyncio, the first step is usually to start merging threads to the main loop, by using `run_coroutine_threadsafe`. This works well and allows to use a single ioloop from different threads.

There is another step, that usually involves the patching of libraries to work in an async way. One will typically patch the IO calls to be asyncio, and using `run_until_complete` proves useful in these situations.

However, at the moment it's not possible to `run_until_complete` from an ioloop. The possibility to be able to patch sync libraries to run in asyncio is something that would help a lot the migration.

This functionality would basically provide a way to continue running the ioloop until the future is resolved.

Sync code -> async code -> Sync code -> Async code

If you know how to have this without spawning an executor, that would be good too, in such case I would rather ask for documentation on how to do it =)
Date User Action Args
2017-02-14 17:17:00txomonsetrecipients: + txomon, gvanrossum, yselivanov
2017-02-14 17:17:00txomonsetmessageid: <>
2017-02-14 17:17:00txomonlinkissue29558 messages
2017-02-14 17:16:59txomoncreate