// Send telemetry event. Log an error if it fails
Send telemetry event. Log an error if it fails
Send telemetry event . Log an error if it fails
pub fn send(&self, event: TelemetryEvent) {
        match self.sender.lock().try_send(event) {
            Ok(_) => {
                // If sender has been blocked before, set bool to false and log message
                if let Ok(_) = self.sender_is_blocked.compare_exchange(
                    true,
                    false,
                    Ordering::SeqCst,
                    Ordering::SeqCst,
                ) {
                    info!("TelemetrySender recovered and resumed sending");
                }
            }
            Err(_) => {
                // If sender has not been blocked before, set bool to true and log error message
                if let Ok(_) = self.sender_is_blocked.compare_exchange(
                    false,
                    true,
                    Ordering::SeqCst,
                    Ordering::SeqCst,
                ) {
                    warn!("TelemetrySender dropped a msg: either buffer is full or no receiver is waiting");
                }
            }
        }
    }
pub fn send ( & self , event : TelemetryEvent ) { match self . sender . lock ( ) . try_send ( event ) { Ok ( _ ) => { // If sender has been blocked before, set bool to false and log message if let Ok ( _ ) = self . sender_is_blocked . compare_exchange ( true , false , Ordering :: SeqCst , Ordering :: SeqCst , ) { info ! ( " " ) ; } } Err ( _ ) => { // If sender has not been blocked before, set bool to true and log error message if let Ok ( _ ) = self . sender_is_blocked . compare_exchange ( false , true , Ordering :: SeqCst , Ordering :: SeqCst , ) { warn ! ( " " ) ; } } } }
Send telemetry event.
Send telemetry event .
&self
event
TelemetryEvent