Method
close
(
&self,
py: Python,
code: Option<u16>,
reason: Option<PyBackedStr>,
)
Source from the content-addressed store, hash-verified
| 87 | /// Closes the WebSocket connection. |
| 88 | #[pyo3(signature = (code=None, reason=None))] |
| 89 | pub fn close( |
| 90 | &self, |
| 91 | py: Python, |
| 92 | code: Option<u16>, |
| 93 | reason: Option<PyBackedStr>, |
| 94 | ) -> PyResult<()> { |
| 95 | py.allow_threads(|| { |
| 96 | pyo3_async_runtimes::tokio::get_runtime().block_on(WebSocket::_close( |
| 97 | self.0.receiver(), |
| 98 | self.0.sender(), |
| 99 | code, |
| 100 | reason, |
| 101 | )) |
| 102 | }) |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | #[pymethods] |
Tested by
no test coverage detected