diff --git a/actix-server/src/worker.rs b/actix-server/src/worker.rs index 8d89fccd..cb99c99d 100644 --- a/actix-server/src/worker.rs +++ b/actix-server/src/worker.rs @@ -135,13 +135,6 @@ pub(crate) struct ServerWorker { shutdown_timeout: Duration, } -/// Set worker to unavailable when dropping. -impl Drop for ServerWorker { - fn drop(&mut self) { - self.rx.close(); - } -} - struct WorkerService { factory: usize, status: WorkerServiceStatus, @@ -377,6 +370,9 @@ impl Default for WorkerState { impl Drop for ServerWorker { fn drop(&mut self) { + /// Close channel on drop. + self.rx.close(); + /// Stop Arbiter Self runs on on drop. Arbiter::current().stop(); } }