Skip to content

armgit / kanzo

Public Imported from GitHub
0

Self-hosted, sharable kanban for humans and agents. One 4.7 MB binary, 5 MB of RAM, 10 to 60 tokens per agent reply, starts in 3 ms, zero setup.

Run on one thread with only the tokio features in use

emanuele-em4fedac002177
diff --git a/Cargo.lock b/Cargo.lock
index 52ebbc2..87751aa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -701,15 +701,6 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
-[[package]]
-name = "lock_api"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
-dependencies = [
- "scopeguard",
-]
-
[[package]]
name = "log"
version = "0.4.34"
@@ -772,29 +763,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
-[[package]]
-name = "parking_lot"
-version = "0.12.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-link",
-]
-
[[package]]
name = "pastey"
version = "0.2.3"
@@ -860,15 +828,6 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
-[[package]]
-name = "redox_syscall"
-version = "0.5.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
-dependencies = [
- "bitflags",
-]
-
[[package]]
name = "redox_users"
version = "0.5.3"
@@ -1020,12 +979,6 @@ dependencies = [
"syn 3.0.9",
]
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
[[package]]
name = "serde"
version = "1.0.229"
@@ -1249,7 +1202,6 @@ dependencies = [
"bytes",
"libc",
"mio",
- "parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2",
diff --git a/Cargo.toml b/Cargo.toml
index 0c1d729..f5fb979 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ rusqlite = { version = "0.41.0", features = ["bundled"] }
schemars = "1.2.3"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.154"
-tokio = { version = "1.54.1", features = ["full"] }
+tokio = { version = "1.54.1", features = ["rt", "macros", "net", "signal", "io-util", "time"] }
tokio-util = "0.7.20"
toml = "1.1.8"
diff --git a/src/main.rs b/src/main.rs
index 2e11fd8..86038fe 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -80,10 +80,18 @@ enum ServiceAction {
Uninstall,
}
-#[tokio::main]
-async fn main() -> ExitCode {
+fn main() -> ExitCode {
let cli = Cli::parse();
- match run(cli).await {
+ // One thread runs all the async work: the board serves one person, and each
+ // agent starts its own `kanzo mcp`. Database calls run on a few blocking
+ // threads that exit when idle. This keeps kanzo light on small boards.
+ let outcome = tokio::runtime::Builder::new_current_thread()
+ .enable_all()
+ .max_blocking_threads(8)
+ .build()
+ .map_err(anyhow::Error::from)
+ .and_then(|rt| rt.block_on(run(cli)));
+ match outcome {
Ok(()) => ExitCode::SUCCESS,
Err(e) => {
eprintln!("kanzo: {e:#}");