Listen for responses of supervisors

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-09-04 16:24:15 +02:00
parent c6077623b0
commit 059d5131e7
6 changed files with 423 additions and 8 deletions

View File

@@ -99,7 +99,7 @@ async fn main() {
// Shared application state
let state = Arc::new(herocoordinator::rpc::AppState::new(service));
// Start router workers (auto-discovered contexts)
// Start router workers (auto-discovered contexts) and a single global inbound listener
{
let base_url = format!("http://{}:{}", cli.mycelium_ip, cli.mycelium_port);
let cfg = herocoordinator::router::RouterConfig {
@@ -110,6 +110,10 @@ async fn main() {
transport_poll_interval_secs: 2,
transport_poll_timeout_secs: 300,
};
// Global inbound listener for supervisor replies via Mycelium popMessage
let _inbound_handle =
herocoordinator::router::start_inbound_listener(service_for_router.clone(), cfg.clone());
// Per-context outbound delivery loops
let _auto_handle = herocoordinator::router::start_router_auto(service_for_router, cfg);
}