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

Function get_msgs

flow-plugins/src/video_server.rs:88–97  ·  view source on GitHub ↗
(#[data] messages: MessagesWithLock, id: u64)

Source from the content-addressed store, hash-verified

86#[get("/get_msgs/{id}")]
87#[openapi(summary = "get messages from video analyze by id")]
88async fn get_msgs(#[data] messages: MessagesWithLock, id: u64) -> Result<impl Reply, Rejection> {
89 let mut messages = messages.lock().await;
90 if let Some(messages) = messages.mapping.get_mut(&id) {
91 let ret = Ok(rweb::reply::json(messages));
92 messages.clear();
93 ret
94 } else {
95 Err(reject::not_found())
96 }
97}
98
99impl VideoServer {
100 fn new(_: String, args: &Table) -> VideoServer {

Callers 1

execMethod · 0.85

Calls 1

get_mutMethod · 0.45

Tested by

no test coverage detected