Found during review of #96. rust/crates/truapi-server/src/subscription.rs spawns one OS thread per active subscription via std::thread::spawn(move || futures::executor::block_on(future)). Subscriptions are long-lived (chain follow, statement-store subscribe, account connection status) so this leaks one thread per stream on native and panics on wasm32 (which has no threads, the file currently has no cfg gate). Fix: drive subscriptions via the dispatcher's own executor — tokio LocalSet on the ws-bridge, wasm-bindgen-futures spawn on wasm, an injected executor handle on UniFFI hosts.
Found during review of #96.
rust/crates/truapi-server/src/subscription.rsspawns one OS thread per active subscription viastd::thread::spawn(move || futures::executor::block_on(future)). Subscriptions are long-lived (chain follow, statement-store subscribe, account connection status) so this leaks one thread per stream on native and panics on wasm32 (which has no threads, the file currently has no cfg gate). Fix: drive subscriptions via the dispatcher's own executor — tokio LocalSet on the ws-bridge, wasm-bindgen-futures spawn on wasm, an injected executor handle on UniFFI hosts.