use builder pattern with gateway

This commit is contained in:
Chris Beck
2025-12-09 09:38:23 -07:00
parent 6ac6beb9be
commit 775c66b287
2 changed files with 77 additions and 3 deletions
+5 -1
View File
@@ -123,7 +123,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
let command_router = router_builder.build();
let gateway = Gateway::new(config.gateway, token.clone(), command_router).await;
let gateway = Gateway::builder(config.gateway)
.with_cancellation_token(token.clone())
.with_command_router(command_router)
.build()
.await;
let listener = TcpListener::bind(config.http_listen_addr).await.unwrap();
info!("Listening for http on {}", config.http_listen_addr);