I would like to implement a async
stdin function for otherwise sync cli application.
I would like to take output from program A ( as a side note, I do not know how much data or how long it will take for the program A to finish) - and pipe it into my program B which is supposed to wait for all of the data and then process it.
I saw this question: How can I read non-blocking from stdin? which kinda works but also loops forever and never actually brakes.
That is why I wanted to use async
and await
( for the stream to close ? ) even tho it might not be the best approach. I looked into tokio::io::stdin()
but implementing an async
function into otherwise sync
code comes with its drawbacks.
What would be the best way of approaching this problem?