How can I use non-blocking up/downloads with ssh2_sftp_ (like with ftp_nb_put/ftp_nb_get)?
Asked
Active
Viewed 144 times
-1
Martin Prikryl
- 167,268
- 50
- 405
- 846
root66
- 449
- 5
- 15
-
The closest thing you could do with phpseclib would be to upload in chunks. More info: http://phpseclib.sourceforge.net/sftp/examples.html#put – neubert Sep 25 '15 at 14:08
1 Answers
0
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
Martin Prikryl
- 167,268
- 50
- 405
- 846