-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
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
Async read of a ssh program stdio. #93
Comments
You need to call RemoteChild::wait. |
is wait meant to be called only once, or can you call it within a loop? while wait is false, read stdio? |
RemoteChild::wait takes RemoteChild by value, so it can be called only once. Checkout RemoteChild::wait_with_output for example. Note that you can just use tokio::spawn instead of tokio::try_join, which is more readable and might yield better performance. |
@redragonx Has your problem been solved by my reply? |
Hopefully I'm not derailing this issue, @NobodyXu. I think I have the same problem, when using
But when trying to do the same with |
You would have to wrap child in an And the current implementation has a strange behavior: If the This is because I recommend to just read from |
I can fix this with a breaking change if people really need this. |
Sorry @NobodyXu I got distracted with life changes and haven't been to dig into this since then. |
No worries, it's open source not coop work, you can do that at any time. |
I'm not really sure how that would be done in this case, sorry.
I'd do that but I pretty much need to handle stdin/stdout/stderr more than once while the process is already running. |
Maybe you can |
Yes, this works to a large extent. Though I kind-of think that it would be much nicer if one could use the same syntax and semantics for both remote SSH and |
It will be fixed by openssh-rust/openssh-mux-client#6 though it has been stale recently, blocking on new release of external dependency tokio-util. |
That's great to hear, will subscribe to that issue. |
How do I go about this the right way? I would like to see an example such that it reads stdio and writes the data to a file in real time.
Here's my current thought process on how I might do the above.
The text was updated successfully, but these errors were encountered: