merge master

This commit is contained in:
fakeshadow 2021-04-13 10:20:41 +08:00
commit 42aa0aa9ff
1 changed files with 6 additions and 6 deletions

View File

@ -127,10 +127,10 @@ impl WorkerAvailability {
pub(crate) struct ServerWorker { pub(crate) struct ServerWorker {
rx: UnboundedReceiver<Conn>, rx: UnboundedReceiver<Conn>,
rx2: UnboundedReceiver<Stop>, rx2: UnboundedReceiver<Stop>,
services: Vec<WorkerService>, services: Box<[WorkerService]>,
availability: WorkerAvailability, availability: WorkerAvailability,
conns: Counter, conns: Counter,
factories: Vec<Box<dyn InternalServiceFactory>>, factories: Box<[Box<dyn InternalServiceFactory>]>,
state: WorkerState, state: WorkerState,
shutdown_timeout: Duration, shutdown_timeout: Duration,
} }
@ -196,7 +196,7 @@ impl ServerWorker {
/// Start server worker in sync. /// Start server worker in sync.
pub(crate) fn start( pub(crate) fn start(
idx: usize, idx: usize,
factories: Vec<Box<dyn InternalServiceFactory>>, factories: Box<[Box<dyn InternalServiceFactory>]>,
avail: WorkerAvailability, avail: WorkerAvailability,
config: ServerWorkerConfig, config: ServerWorkerConfig,
) -> io::Result<(WorkerHandleAccept, WorkerHandleServer)> { ) -> io::Result<(WorkerHandleAccept, WorkerHandleServer)> {
@ -217,7 +217,7 @@ impl ServerWorker {
/// Start server worker in async. /// Start server worker in async.
pub(crate) fn start_non_blocking( pub(crate) fn start_non_blocking(
idx: usize, idx: usize,
factories: Vec<Box<dyn InternalServiceFactory>>, factories: Box<[Box<dyn InternalServiceFactory>]>,
avail: WorkerAvailability, avail: WorkerAvailability,
config: ServerWorkerConfig, config: ServerWorkerConfig,
) -> impl Future<Output = io::Result<(WorkerHandleAccept, WorkerHandleServer)>> { ) -> impl Future<Output = io::Result<(WorkerHandleAccept, WorkerHandleServer)>> {
@ -239,7 +239,7 @@ impl ServerWorker {
fn _start<F>( fn _start<F>(
idx: usize, idx: usize,
factories: Vec<Box<dyn InternalServiceFactory>>, factories: Box<[Box<dyn InternalServiceFactory>]>,
availability: WorkerAvailability, availability: WorkerAvailability,
config: ServerWorkerConfig, config: ServerWorkerConfig,
f: F, f: F,
@ -304,7 +304,7 @@ impl ServerWorker {
let worker = ServerWorker { let worker = ServerWorker {
rx, rx,
rx2, rx2,
services, services: services.into_boxed_slice(),
availability, availability,
conns: Counter::new(config.max_concurrent_connections), conns: Counter::new(config.max_concurrent_connections),
factories, factories,