MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / update_agent_info_from_response

Method update_agent_info_from_response

packages/server/src/inspector.rs:376–397  ·  view source on GitHub ↗
(&self, process_identifier: i64, response: &Value)

Source from the content-addressed store, hash-verified

374 }
375
376 async fn update_agent_info_from_response(&self, process_identifier: i64, response: &Value) {
377 let Some(info) = inspector_info_from_response(response) else {
378 return;
379 };
380 if info.get("processIdentifier").and_then(Value::as_i64) != Some(process_identifier) {
381 return;
382 }
383
384 let mut heartbeat_connection_id = None;
385 let mut inner = self.inner.lock().await;
386 if let Some(agent) = inner.agents.get_mut(&process_identifier) {
387 if agent.info.is_null() {
388 heartbeat_connection_id = Some(agent.connection_id);
389 }
390 agent.info = info.clone();
391 }
392 drop(inner);
393 self.publish_inspector(process_identifier, &info).await;
394 if let Some(connection_id) = heartbeat_connection_id {
395 self.start_registry_heartbeat(process_identifier, connection_id);
396 }
397 }
398
399 async fn publish_inspector(&self, process_identifier: i64, info: &Value) {
400 let Some(registry) = self.registry.as_ref() else {

Callers 1

complete_responseMethod · 0.80

Calls 5

publish_inspectorMethod · 0.80
getMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected