Moved stdin onto root

This commit is contained in:
Dave
2025-06-12 16:27:41 -04:00
parent b933f8d6fc
commit 0126614dd3
3 changed files with 2 additions and 2 deletions

11
crdt-node/src/stdin.rs Normal file
View File

@@ -0,0 +1,11 @@
use std::io::BufRead;
/// Wait for stdin terminal input and send it to the node if any arrives
pub(crate) fn input(stdin_sender: std::sync::mpsc::Sender<String>) {
let stdin = std::io::stdin();
let lines = stdin.lock().lines();
for line in lines {
let line = line.unwrap();
stdin_sender.send(line).unwrap();
}
}