use crate::{
    Pid,
    services::{Services, with_services},
};

impl Services {
    fn list_pool(&self, pool_name: &str) -> &[Pid] {
        self.topology.list_pool(pool_name)
    }
}

/// Returns a vector  of all process pids in the named pool.
pub fn list_pool(pool_name: &str) -> Vec<Pid> {
    // Can we do the same but without to_vec()?
    with_services(|services| services.list_pool(pool_name).to_vec())
}
