python-streamexpect
python-streamexpect copied to clipboard
Implement asyncio functionality
A general catch-all issue for integrating asyncio ideas into streamexpect. For example, integrating with asyncio.StreamReader and asyncio.StreamWriter, and providing methods for asynchronously waiting on multiple patterns/multiple streams using the asyncio.wait_for function.
For reference (not saying this is the right way to do it), Pexpect supports yield from s.expect('...', async=True)
within asyncio coroutines. The pexpect.async module is what powers that. I hope that's of some use to someone implementing this!
Thanks @takluyver! I'm embarrassed to admit that I have not yet dug into async patterns as deeply as I should, so this will be a helpful guide.
As always, if anyone visiting this would like to help contribute with a PR, they are always welcome.