fn drop(&mut self) {
        #[cfg(not(feature = "wasm"))]
        if let Some(sender) = self.sync_kill_sender.take() {
            sender.send(()).expect("failed to stop syncing process");
        }

        #[cfg(not(feature = "wasm"))]
        if let Some(runtime) = self.runtime.take() {
            runtime.shutdown_background();
        }

        #[cfg(feature = "mqtt")]
        if let Some(mqtt_client) = self.mqtt_client.take() {
            std::thread::spawn(move || {
                // ignore errors in case the event loop was already dropped
                // .cancel() finishes the event loop right away
                let _ = crate::async_runtime::block_on(mqtt_client.cancel());
            })
            .join()
            .unwrap();
        }
    }
/// Gracefully shutdown the `Client`
Gracefully shutdown the `Client`
Gracefully shutdown the ` Client `
fn drop(&mut self) {
        #[cfg(not(feature = "wasm"))]
        if let Some(sender) = self.sync_kill_sender.take() {
            sender.send(()).expect("failed to stop syncing process");
        }
        #[cfg(not(feature = "wasm"))]
        if let Some(runtime) = self.runtime.take() {
            runtime.shutdown_background();
        }
        #[cfg(feature = "mqtt")]
        if let Some(mqtt_client) = self.mqtt_client.take() {
            std::thread::spawn(move || {
                // ignore errors in case the event loop was already dropped
                // .cancel() finishes the event loop right away
                let _ = crate::async_runtime::block_on(mqtt_client.cancel());
            })
            .join()
            .unwrap();
        }
    }
fn drop ( & mut self ) { # [ cfg ( not ( feature " " ) ) ] if let Some ( sender ) = self . sync_kill_sender . take ( ) { sender . send ( ( ) ) . expect ( " " ) ; } # [ cfg ( not ( feature " " ) ) ] if let Some ( runtime ) = self . runtime . take ( ) { runtime . shutdown_background ( ) ; } # [ cfg ( feature " " ) ] if let Some ( mqtt_client ) = self . mqtt_client . take ( ) { std :: thread :: spawn ( move | | { // ignore errors in case the event loop was already dropped // .cancel() finishes the event loop right away let _ = crate :: async_runtime :: block_on ( mqtt_client . cancel ( ) ) ; } ) . join ( ) . unwrap ( ) ; } }
Gracefully shutdown the `Client`
Gracefully shutdown the ` Client `
&mut self
&mut self