/// Process connection requests
/// Requests are usually send as result of action by other controller
Process connection requests
Requests are usually send as result of action by other controller
Process connection requests Requests are usually send as result of action by other controller
pub async fn process_requests(&self, requests: Actions<ConnectionRequest>) {
        trace!("processing connection request: {:?}", requests);
        for request in requests.into_iter() {
            match request {
                ConnectionRequest::Spu(spec_changes) => match spec_changes {
                    SpuSpecChange::Add(new_spu) => {
                        self.add_spu(new_spu).await;
                    }
                    SpuSpecChange::Mod(new_spu, old_spu) => {
                        self.update_spu(new_spu, old_spu).await;
                    }
                    SpuSpecChange::Remove(spu) => {
                        self.remove_spu(spu).await;
                    }
                },
                ConnectionRequest::RefreshSpu(spu_id) => {
                    log_on_err!(self.refresh_spu(spu_id).await);
                }
                ConnectionRequest::Partition(partition_req) => {
                    match partition_req {
                        PartitionSpecChange::Add(key, spec) => {
                            self.refresh_partition(key, spec).await;
                        }
                        PartitionSpecChange::Mod(key, new_spec, _) => {
                            // for now, only send new
                            self.refresh_partition(key, new_spec).await;
                        }
                        _ => {}
                    }
                }
            }
        }
    }
pub async fn process_requests ( & self , requests : Actions < ConnectionRequest > ) { trace ! ( " " requests ) ; for request in requests . into_iter ( ) { match request { ConnectionRequest :: Spu ( spec_changes ) => match spec_changes { SpuSpecChange :: Add ( new_spu ) => { self . add_spu ( new_spu ) . await ; } SpuSpecChange :: Mod ( new_spu , old_spu ) => { self . update_spu ( new_spu , old_spu ) . await ; } SpuSpecChange :: Remove ( spu ) => { self . remove_spu ( spu ) . await ; } } , ConnectionRequest :: RefreshSpu ( spu_id ) => { log_on_err ! ( self refresh_spu ( spu_id ) await ) ; } ConnectionRequest :: Partition ( partition_req ) => { match partition_req { PartitionSpecChange :: Add ( key , spec ) => { self . refresh_partition ( key , spec ) . await ; } PartitionSpecChange :: Mod ( key , new_spec , _ ) => { // for now, only send new self . refresh_partition ( key , new_spec ) . await ; } _ => { } } } } } }
Process connection requests
Requests are usually send as result of action by other controller
Process connection requests Requests are usually send as result of action by other controller
&self
requests
Actions<ConnectionRequest>