///
/// Compute next state for topic
/// if state is different, apply actions
///
Compute next state for topic
if state is different, apply actions
Compute next state for topic if state is different apply actions
fn update_actions_next_state(&self, topic: &TopicKV, actions: &mut TopicActions) {
        let next_state = topic.compute_next_state(self.spu_store(), self.partition_store());
        debug!("topic: {} next state: {}",topic.key(),next_state);
        let mut updated_topic = topic.clone();
        trace!("next state detal: {:#?}", next_state);
        // apply changes in partitions
        for partition_kv in updated_topic.apply_next_state(next_state).into_iter() {
            actions
                .partitions
                .push(PartitionWSAction::Add(partition_kv));
        }
        // apply changes to topics
        if updated_topic.status.resolution != topic.status.resolution || updated_topic.status.reason != topic.status.reason {
            debug!("{} status change to {} from: {}",topic.key(),updated_topic.status,topic.status);
            actions.topics.push(TopicWSAction::UpdateStatus(updated_topic));
        } 
    }
fn update_actions_next_state ( & self , topic : & TopicKV , actions : & mut TopicActions ) { let next_state = topic . compute_next_state ( self . spu_store ( ) , self . partition_store ( ) ) ; debug ! ( " " topic key ( ) next_state ) ; let mut updated_topic = topic . clone ( ) ; trace ! ( " " next_state ) ; // apply changes in partitions for partition_kv in updated_topic . apply_next_state ( next_state ) . into_iter ( ) { actions . partitions . push ( PartitionWSAction :: Add ( partition_kv ) ) ; } // apply changes to topics if updated_topic . status . resolution != topic . status . resolution || updated_topic . status . reason != topic . status . reason { debug ! ( " " topic key ( ) updated_topic status topic status ) ; actions . topics . push ( TopicWSAction :: UpdateStatus ( updated_topic ) ) ; } }
Compute next state for topic
if state is different, apply actions
Compute next state for topic if state is different apply actions
&self
topic
&TopicKV
actions
&mut TopicActions