We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exec和scp的执行过程中,可能需要增加一些控制点:
建议用mpsc::channel()搭建跨线程的共享缓存,利用缓存记录任务状态,实现以上控制点功能。
The text was updated successfully, but these errors were encountered:
感谢您的提议。
关于您提议的三点,
run_local
scp
exec
run_backend
cancel
abort
local
backend
async
where S: Read + Write
如果还有更多建议与问题,烦请告知
BRs.
P.S. 关于并发执行的POC,您可以尝试
use ssh_rs::ssh; fn main() { ssh::enable_log(); let mut session = ssh::create_session() .username("ubuntu") .password("password") .private_key_path("./id_rsa") .connect("127.0.0.1:22") .unwrap() .run_backend(); let exec = session.open_exec().unwrap(); let exec2 = session.open_exec().unwrap(); const CMD: &str = "sleep 10 && date"; // send the command to server println!("Send command {}", CMD); exec.send_command(CMD).unwrap(); exec2.send_command(CMD).unwrap(); // process other data println!("Do someother thing"); // get command result let vec: Vec<u8> = exec.get_result().unwrap(); println!("{}", String::from_utf8(vec).unwrap()); let vec2: Vec<u8> = exec2.get_result().unwrap(); println!("{}", String::from_utf8(vec2).unwrap()); // Close session. session.close(); }
Sorry, something went wrong.
No branches or pull requests
exec和scp的执行过程中,可能需要增加一些控制点:
建议用mpsc::channel()搭建跨线程的共享缓存,利用缓存记录任务状态,实现以上控制点功能。
The text was updated successfully, but these errors were encountered: