How can I use non-blocking up/downloads with ssh2_sftp_
(like with ftp_nb_put
/ftp_nb_get
)?
The PHP SSH2 functions do not support non-blocking operation. Neither phpseclib does.
But you can move your download code to a separate thread using the Thread
PECL class.
For an example see:
How can one use multi threading in PHP applications
Or you can upload the file in chunks.
See https://phpseclib.com/docs/sftp#positional-control