async fn found_node(&self, node: &Node) {
        match &node.state {
            NodeState::Online => {
                self.add_or_update_node(node).await;
            }
            state => {
                // if not online, then only update the node state if it already
                // exists in the registry, and don't even try to
                // add it
                let mut registry = self.nodes.lock().await;
                if let Some((_, existing_node)) =
                    registry.iter_mut().find(|(id, _)| id == &&node.id)
                {
                    existing_node.set_state(state.clone());
                }
            }
        }
    }
/// Found this node via the node service
/// Update its resource list or add it to the registry if not there yet
Found this node via the node service
Update its resource list or add it to the registry if not there yet
Found this node via the node service Update its resource list or add it to the registry if not there yet
async fn found_node(&self, node: &Node) {
        match &node.state {
            NodeState::Online => {
                self.add_or_update_node(node).await;
            }
            state => {
                // if not online, then only update the node state if it already
                // exists in the registry, and don't even try to
                // add it
                let mut registry = self.nodes.lock().await;
                if let Some((_, existing_node)) =
                    registry.iter_mut().find(|(id, _)| id == &&node.id)
                {
                    existing_node.set_state(state.clone());
                }
            }
        }
    }
async fn found_node ( & self , node : & Node ) { match & node . state { NodeState :: Online => { self . add_or_update_node ( node ) . await ; } state => { // if not online, then only update the node state if it already // exists in the registry, and don't even try to // add it let mut registry = self . nodes . lock ( ) . await ; if let Some ( ( _ , existing_node ) ) = registry . iter_mut ( ) . find ( | ( id , _ ) | id == & & node . id ) { existing_node . set_state ( state . clone ( ) ) ; } } } }
Found this node via the node service
Update its resource list or add it to the registry if not there yet
Found this node via the node service Update its resource list or add it to the registry if not there yet
&self
node
&Node