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

Function stop

flow-plugins/src/video_server.rs:66–73  ·  view source on GitHub ↗
(#[data] state: State, id: u64)

Source from the content-addressed store, hash-verified

64#[post("/stop/{id}")]
65#[openapi(summary = "stop a video stream by id")]
66async fn stop(#[data] state: State, id: u64) -> RwebResult {
67 if let Some((_, sender)) = state.mapping.lock().await.remove(&id) {
68 sender.close();
69 Ok(format!("stop stream {} success", id))
70 } else {
71 Err(reject::not_found())
72 }
73}
74
75#[get("/list")]
76#[openapi(summary = "list all video streams")]

Callers 1

execMethod · 0.85

Calls 2

removeMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected