bbox-map-server 0.6.0

BBOX map server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::dispatcher::{DispatchConfig, RequestDispatcher};
use crate::fcgi_process::FcgiClientPool;
use rand::Rng;

pub struct Dispatcher {
    pool_size: usize,
}

impl RequestDispatcher for Dispatcher {
    fn new(_config: &DispatchConfig, pools: &Vec<FcgiClientPool>) -> Self {
        Self {
            pool_size: pools.len(),
        }
    }
    fn select(&mut self, _query_str: &str) -> usize {
        rand::thread_rng().gen_range(0, self.pool_size)
    }
}