async fn teardown_if_needed(&mut self) {
        if self.has_active_work() {
            return;
        }

        let signature = self.client_signature.take().expect("signature should be set");

        let mut controller_receptor = self
            .messenger
            .message(
                setting_handler::Payload::Command(Command::ChangeState(State::Teardown)).into(),
                Audience::Messenger(signature),
            )
            .send();

        // Wait for the teardown phase to be over before continuing.
        if controller_receptor.next().await != Some(MessageEvent::Status(Status::Received)) {
            fx_log_err!("Failed to tear down {:?} controller", self.setting_type);
        }

        // This ensures that the client event loop for the corresponding controller is
        // properly stopped. Without this, the client event loop will run forever.
        self.messenger_factory.delete(signature);

        publish!(self, event::handler::Event::Teardown);
    }
/// Transitions the controller for the [setting_type] to the Teardown phase
/// and removes it from the active_controllers.
Transitions the controller for the [setting_type] to the Teardown phase
and removes it from the active_controllers.
Transitions the controller for the [ setting_type ] to the Teardown phase and removes it from the active_controllers .
async fn teardown_if_needed(&mut self) {
        if self.has_active_work() {
            return;
        }
        let signature = self.client_signature.take().expect("signature should be set");
        let mut controller_receptor = self
            .messenger
            .message(
                setting_handler::Payload::Command(Command::ChangeState(State::Teardown)).into(),
                Audience::Messenger(signature),
            )
            .send();
        // Wait for the teardown phase to be over before continuing.
        if controller_receptor.next().await != Some(MessageEvent::Status(Status::Received)) {
            fx_log_err!("Failed to tear down {:?} controller", self.setting_type);
        }
        // This ensures that the client event loop for the corresponding controller is
        // properly stopped. Without this, the client event loop will run forever.
        self.messenger_factory.delete(signature);
        publish!(self, event::handler::Event::Teardown);
    }
async fn teardown_if_needed ( & mut self ) { if self . has_active_work ( ) { return ; } let signature = self . client_signature . take ( ) . expect ( " " ) ; let mut controller_receptor = self . messenger . message ( setting_handler :: Payload :: Command ( Command :: ChangeState ( State :: Teardown ) ) . into ( ) , Audience :: Messenger ( signature ) , ) . send ( ) ; // Wait for the teardown phase to be over before continuing. if controller_receptor . next ( ) . await != Some ( MessageEvent :: Status ( Status :: Received ) ) { fx_log_err ! ( " " self setting_type ) ; } // This ensures that the client event loop for the corresponding controller is // properly stopped. Without this, the client event loop will run forever. self . messenger_factory . delete ( signature ) ; publish ! ( self event handler Event Teardown ) ; }
Transitions the controller for the [setting_type] to the Teardown phase
and removes it from the active_controllers.
Transitions the controller for the [ setting_type ] to the Teardown phase and removes it from the active_controllers .
&mut self
&mut self