MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / shutdown

Method shutdown

cassandra/cluster.py:1752–1778  ·  view source on GitHub ↗

Closes all sessions and connection associated with this Cluster. To ensure all connections are properly closed, **you should always call shutdown() on a Cluster instance when you are done with it**. Once shutdown, a Cluster should not be used for any purpose.

(self)

Source from the content-addressed store, hash-verified

1750 return holders
1751
1752 def shutdown(self):
1753 """
1754 Closes all sessions and connection associated with this Cluster.
1755 To ensure all connections are properly closed, **you should always
1756 call shutdown() on a Cluster instance when you are done with it**.
1757
1758 Once shutdown, a Cluster should not be used for any purpose.
1759 """
1760 with self._lock:
1761 if self.is_shutdown:
1762 return
1763 else:
1764 self.is_shutdown = True
1765
1766 if self._idle_heartbeat:
1767 self._idle_heartbeat.stop()
1768
1769 self.scheduler.shutdown()
1770
1771 self.control_connection.shutdown()
1772
1773 for session in tuple(self.sessions):
1774 session.shutdown()
1775
1776 self.executor.shutdown()
1777
1778 _discard_cluster_shutdown(self)
1779
1780 def __enter__(self):
1781 return self

Callers 15

test_custom_endpointMethod · 0.95
test_duplicateMethod · 0.95
connect_and_shutdownMethod · 0.95
connect_and_shutdownMethod · 0.95
connectMethod · 0.95
__exit__Method · 0.95
setupFunction · 0.95
teardownFunction · 0.95

Calls 2

stopMethod · 0.45