[router] Implement HTTP Dependency Injection Pattern for Router System (#8714)

This commit is contained in:
Simo Lin
2025-08-02 19:16:47 -07:00
committed by GitHub
parent 8ada1ab6c7
commit 828a4fe944
12 changed files with 197 additions and 186 deletions

View File

@@ -53,10 +53,12 @@ impl TestContext {
config.mode = RoutingMode::Regular { worker_urls };
let router = tokio::task::spawn_blocking(move || RouterFactory::create_router(&config))
.await
.unwrap()
.unwrap();
let app_context = common::create_test_context(config);
let router =
tokio::task::spawn_blocking(move || RouterFactory::create_router(&app_context))
.await
.unwrap()
.unwrap();
let router = Arc::from(router);
if !workers.is_empty() {