[Misc] add service discovery for sgl router

This commit is contained in:
Simo Lin
2025-04-29 10:21:19 -07:00
committed by GitHub
parent 91dda4cd06
commit 1468769bde
11 changed files with 1242 additions and 45 deletions

View File

@@ -240,6 +240,15 @@ impl Router {
})
}
/// Get a reference to the worker URLs shared across threads
pub fn get_worker_urls(&self) -> Arc<RwLock<Vec<String>>> {
match self {
Router::RoundRobin { worker_urls, .. } => Arc::clone(worker_urls),
Router::Random { worker_urls, .. } => Arc::clone(worker_urls),
Router::CacheAware { worker_urls, .. } => Arc::clone(worker_urls),
}
}
fn wait_for_healthy_workers(
worker_urls: &[String],
timeout_secs: u64,