Get the sender of a web socket.
(&self, id: &WebSocketId)
| 130 | |
| 131 | /// Get the sender of a web socket. |
| 132 | pub async fn get_web_socket(&self, id: &WebSocketId) -> anyhow::Result<WebSocketSender> { |
| 133 | let guard = self.web_sockets.read().await; |
| 134 | guard |
| 135 | .get(id) |
| 136 | .cloned() |
| 137 | .ok_or_else(|| anyhow!("web socket not found")) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | /// Represents the actor type of a concrete actor. |