soma_gateway/gateway/manager/pool_lifecycle.rs
1use crate::config::GatewayConfig;
2use crate::upstream::pool::{PoolOptions, UpstreamPool};
3use crate::upstream::UpstreamError;
4
5pub fn build_pool_from_config(config: &GatewayConfig) -> Result<UpstreamPool, UpstreamError> {
6 let pool = UpstreamPool::new(PoolOptions::default());
7 for upstream in &config.upstream {
8 pool.register_config(upstream.clone())?;
9 }
10 Ok(pool)
11}
12
13#[cfg(test)]
14#[path = "pool_lifecycle_tests.rs"]
15mod tests;