in reply to using SSH2 backend
I was trying to figure out the confusing blocking problem, and came across this in the perldoc
It would seem that with the shell() method, you may need blocking(0). I suggest trying both ways. :-)blocking ( flag ) Enable or disable blocking. A good number of the methods in Net::SSH2/libssh2 can not work in non- +blocking mode. Some of them may just forcibly enable blocking during +its execution. A few may even corrupt the SSH session or crash the pr +ogram. The ones that can be safely called are read and, with some caveats, wr +ite. See "write" in Net::SSH2::Channel. Don't hesitate to report any bug you found in that area!
Maybe the resident expert Salva would explain exactly what blocking() does, so we can sort this out once and for all.
Here is a plausible explanation: blocking vs non-blocking Which says:
The reason is that if you want to do two things at once, say read from + some other network connection, and your SSH session, you have two options: use blocking APIs, and use two threads or processes so you can do +them both use non-blocking APIs so the same thread can do both This latter approach is called Asynchronous I/O. See for example twist +ed which uses it extensively.
I'm not really a human, but I play one on earth. ..... an animated JAPH