async fn run_loop(&mut self) {
        let mut events = vec![];
        let duration = self.config.max_flush_duration;
        loop {
            let recv_future = self.events_queue.recv();
            let result = tokio::time::timeout(duration, recv_future).await;
            match result {
                Ok(Some(event)) => {
                    events.push(event);
                    if events.len() >= self.config.max_batch_size {
                        self.flush(&mut events).await;
                    }
                }
                Ok(None) => {
                    self.flush(&mut events).await;
                    break;
                }
                Err(_) => {
                    self.flush(&mut events).await;
                }
            }
        }
    }
/// Runs a debounced loop to flush events
Runs a debounced loop to flush events
Runs a debounced loop to flush events
async fn run_loop(&mut self) {
        let mut events = vec![];
        let duration = self.config.max_flush_duration;
        loop {
            let recv_future = self.events_queue.recv();
            let result = tokio::time::timeout(duration, recv_future).await;
            match result {
                Ok(Some(event)) => {
                    events.push(event);
                    if events.len() >= self.config.max_batch_size {
                        self.flush(&mut events).await;
                    }
                }
                Ok(None) => {
                    self.flush(&mut events).await;
                    break;
                }
                Err(_) => {
                    self.flush(&mut events).await;
                }
            }
        }
    }
async fn run_loop ( & mut self ) { let mut events = vec ! [ ] ; let duration = self . config . max_flush_duration ; loop { let recv_future = self . events_queue . recv ( ) ; let result = tokio :: time :: timeout ( duration , recv_future ) . await ; match result { Ok ( Some ( event ) ) => { events . push ( event ) ; if events . len ( ) >= self . config . max_batch_size { self . flush ( & mut events ) . await ; } } Ok ( None ) => { self . flush ( & mut events ) . await ; break ; } Err ( _ ) => { self . flush ( & mut events ) . await ; } } } }
Runs a debounced loop to flush events
Runs a debounced loop to flush events
&mut self
&mut self