Skip to content

[Question] Concurrent get from sftp connection #369

@hn-sl

Description

@hn-sl
import asyncssh
import asyncio

conn = await asyncssh.connect(host=host, username=username, password=password)
sftp = await conn.start_sftp_client() # single sftp channel 
task1 = sftp.get(file1, localpath1)
task1 = sftp.get(file2, localpath2)
await asyncio.gather(task1, task2) # concurrent download through single sftp channel? 

I confirmed that file1 and file2 are downloaded in concurrency. If there are multiple sftp channels this makes sense, but If there is only one sftp channel as in this code, how is this possible ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions