Struct copra::server::ServerBuilder
[−]
[src]
pub struct ServerBuilder<'a> { /* fields omitted */ }
Server factory, which can be used to setup up a new server
You can chain up the methods to configure the channel.
Methods
impl<'a> ServerBuilder<'a>
[src]
fn new(addr: &'a str, services: ServiceRegistry) -> Self
[src]
Create a server listening to addr
.
fn threads(self, threads: usize) -> Self
[src]
Set the number of event loops.
The thread number should not exceed the CPU core number. Default to 1.
fn protocols(self, protocols: Vec<Protocol>) -> Self
[src]
[WIP] Set the protocols that the server willing to support.
fn idle_secs(self, idle: u64) -> Self
[src]
Keep an idle connection for idle
seconds before it iS shuted down
by the server.
Default to 60 seconds
fn throughput(self, throughput: Arc<AtomicUsize>, remote: Remote) -> Self
[src]
[WIP] Server monitor, expose throught to the shared variable
throughput
.
fn build(self) -> Result<Server, ServerBuildError>
[src]
Consume the builder and build.