python-executor icon indicating copy to clipboard operation
python-executor copied to clipboard

compatibility with asyncio

Open matthias-k opened this issue 5 years ago • 0 comments

Hi!

Is there a way to use executor in the context of async awaits with python's asyncio library? I'm aware of executor.ssh.client.foreach, but in my case I need to call a lot of remote commands via many nested functions, so foreach is not easily applicable here. It would be awesome to be able to write

async def get_data(target):
    cmd = RemoteCommand(target, 'somecommand')
    cmd.start()
    await cmd.wait()
    return cmd.output

Thank you for this incredibly helpful library!

matthias-k avatar Jan 23 '20 17:01 matthias-k