mirror of https://github.com/fafhrd91/actix-net
Add note for field order of ServerWorker
This commit is contained in:
parent
b18dd4b05f
commit
6c18af80f0
|
@ -125,6 +125,8 @@ impl WorkerAvailability {
|
|||
///
|
||||
/// Worker accepts Socket objects via unbounded channel and starts stream processing.
|
||||
pub(crate) struct ServerWorker {
|
||||
// UnboundedReceiver<Conn> should always the first field.
|
||||
// It must be dropped as soon as ServerWorker dropping.
|
||||
rx: UnboundedReceiver<Conn>,
|
||||
rx2: UnboundedReceiver<Stop>,
|
||||
services: Box<[WorkerService]>,
|
||||
|
@ -370,9 +372,7 @@ 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.
|
||||
// Stop Arbiter Self runs on on drop.
|
||||
Arbiter::current().stop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue