Method
websocket
(
&self,
py: Python,
url: PyBackedStr,
kwds: Option<WebSocketParams>,
)
Source from the content-addressed store, hash-verified
| 124 | /// Make a WebSocket request to the specified URL. |
| 125 | #[pyo3(signature = (url, **kwds))] |
| 126 | pub fn websocket( |
| 127 | &self, |
| 128 | py: Python, |
| 129 | url: PyBackedStr, |
| 130 | kwds: Option<WebSocketParams>, |
| 131 | ) -> PyResult<BlockingWebSocket> { |
| 132 | py.allow_threads(|| { |
| 133 | let client = self.0.clone(); |
| 134 | pyo3_async_runtimes::tokio::get_runtime() |
| 135 | .block_on(execute_websocket_request(client, url, kwds)) |
| 136 | .map(Into::into) |
| 137 | }) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | #[pymethods] |