MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / dowith_request

Function dowith_request

flow-rs/src/debug/server.rs:101–118  ·  view source on GitHub ↗
(req: RequestMessage)

Source from the content-addressed store, hash-verified

99 unimplemented!()
100}
101async fn dowith_request(req: RequestMessage) -> Result<()> {
102 match req.command.as_str() {
103 CMD_START => {
104 let command = FeatureCommand::registry_global()
105 .get(&req.feature)
106 .ok_or_else(|| anyhow!("feature[{}] not found", req.feature))?;
107 (command.start)(req.seq_id, serde_json::Value::Object(req.args));
108 }
109 CMD_STOP => {
110 let command = FeatureCommand::registry_global()
111 .get(&req.feature)
112 .ok_or_else(|| anyhow!("feature[{}] not found", req.feature))?;
113 (command.stop)(req.seq_id);
114 }
115 _ => unreachable!(),
116 }
117 Ok(())
118}
119
120/// A server for debug
121pub struct Server {

Callers 1

connectedFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected