async fn sync_spu_changes(&mut self, listener: &mut ChangeListener<SpuSpec, C>) {
        if !listener.has_change() {
            trace!("no spu changes");
            return;
        }

        let changes = listener.sync_status_changes().await;
        if changes.is_empty() {
            debug!("no spu status changes");
            return;
        }

        let epoch = changes.epoch;
        let (updates, deletes) = changes.parts();
        debug!(
            epoch,
            updates = updates.len(),
            deletes = deletes.len(),
            "spu changes",
        );

        let actions = self
            .reducer
            .update_election_from_spu_changes(updates.into_iter().collect())
            .await;

        debug!("there were election actions: {}", actions.len());
        for action in actions.into_iter() {
            self.partitions.send_action(action).await;
        }
    }
/// sync spu states to partition
/// check to make sure
sync spu states to partition
check to make sure
sync spu states to partition check to make sure
async fn sync_spu_changes(&mut self, listener: &mut ChangeListener<SpuSpec, C>) {
        if !listener.has_change() {
            trace!("no spu changes");
            return;
        }
        let changes = listener.sync_status_changes().await;
        if changes.is_empty() {
            debug!("no spu status changes");
            return;
        }
        let epoch = changes.epoch;
        let (updates, deletes) = changes.parts();
        debug!(
            epoch,
            updates = updates.len(),
            deletes = deletes.len(),
            "spu changes",
        );
        let actions = self
            .reducer
            .update_election_from_spu_changes(updates.into_iter().collect())
            .await;
        debug!("there were election actions: {}", actions.len());
        for action in actions.into_iter() {
            self.partitions.send_action(action).await;
        }
    }
async fn sync_spu_changes ( & mut self , listener : & mut ChangeListener < SpuSpec , C > ) { if ! listener . has_change ( ) { trace ! ( " " ) ; return ; } let changes = listener . sync_status_changes ( ) . await ; if changes . is_empty ( ) { debug ! ( " " ) ; return ; } let epoch = changes . epoch ; let ( updates , deletes ) = changes . parts ( ) ; debug ! ( epoch updates updates len ( ) deletes deletes len ( ) " " ) ; let actions = self . reducer . update_election_from_spu_changes ( updates . into_iter ( ) . collect ( ) ) . await ; debug ! ( " " actions len ( ) ) ; for action in actions . into_iter ( ) { self . partitions . send_action ( action ) . await ; } }
sync spu states to partition
check to make sure
sync spu states to partition check to make sure
&mut self
listener
&mut ChangeListener<SpuSpec, C>
&mut self
listener
&mut ChangeListener<SpuSpec, C>