Function
stop
(#[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")] |
| 66 | async 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")] |
Tested by
no test coverage detected