gmf 2.0.0

A runtime-agnostic, high-performance gRPC server framework using thread-per-core architecture.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::net::SocketAddr;

pub struct ServerConfig {
    pub addr: SocketAddr,
    pub max_connections: usize,
    pub num_cores: Option<usize>,
}

impl ServerConfig {
    pub fn effective_cores(&self) -> usize {
        self.num_cores.unwrap_or_else(num_cpus::get_physical)
    }
}