sausage core: modules per topic, journal writer thread with WAL and batches, hash cache by metadata, 49 tests per rule

Blank stdout lines give no warning. core.exit requests the exit in its
own handler.
This commit is contained in:
2026-10-23 00:32:33 +01:00
parent 218a718a3d
commit 8542b9fcb8
17 changed files with 2016 additions and 814 deletions
+24
View File
@@ -0,0 +1,24 @@
//! The minimal console reads explicit JSON-RPC calls and the quit command.
use crate::Host;
use tokio::io::{AsyncBufReadExt, BufReader};
/// Read console lines until EOF or quit, and print each call's result.
pub async fn run_input(host: Host) -> anyhow::Result<()> {
let mut lines = BufReader::new(tokio::io::stdin()).lines();
while let Some(line) = lines.next_line().await? {
if line == "quit" {
break;
}
let (method, params) = line.split_once(' ').unwrap_or((&line, "{}"));
match serde_json::from_str(params) {
Ok(params) => {
let value = match host.call(method, params).await {
Ok(value) | Err(value) => value,
};
println!("{value}");
}
Err(error) => eprintln!("{error}"),
}
}
Ok(())
}