MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / close

Method close

cassandra/io/twistedreactor.py:275–292  ·  view source on GitHub ↗

Disconnect and error-out all requests.

(self)

Source from the content-addressed store, hash-verified

273 self._send_options_message()
274
275 def close(self):
276 """
277 Disconnect and error-out all requests.
278 """
279 with self.lock:
280 if self.is_closed:
281 return
282 self.is_closed = True
283
284 log.debug("Closing connection (%s) to %s", id(self), self.endpoint)
285 reactor.callFromThread(self.transport.connector.disconnect)
286 log.debug("Closed socket to %s", self.endpoint)
287
288 if not self.is_defunct:
289 self.error_all_requests(
290 ConnectionShutdown("Connection to %s was closed" % self.endpoint))
291 # don't leave in-progress operations hanging
292 self.connected_event.set()
293
294 def handle_read(self):
295 """

Callers

nothing calls this directly

Calls 2

ConnectionShutdownClass · 0.90
error_all_requestsMethod · 0.80

Tested by

no test coverage detected