MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / close

Method close

src/client/blocking/response/ws.rs:89–103  ·  view source on GitHub ↗
(
        &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]

Callers 1

__exit__Method · 0.45

Calls 2

receiverMethod · 0.80
senderMethod · 0.80

Tested by

no test coverage detected