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

Method _cleanup

cassandra/io/libevreactor.py:116–138  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 break
115
116 def _cleanup(self):
117 self._shutdown = True
118 if not self._thread:
119 return
120
121 for conn in self._live_conns | self._new_conns | self._closed_conns:
122 conn.close()
123 for watcher in (conn._write_watcher, conn._read_watcher):
124 if watcher:
125 watcher.stop()
126
127 self.notify() # wake the timer watcher
128
129 # PYTHON-752 Thread might have just been created and not started
130 with self._lock_thread:
131 self._thread.join(timeout=1.0)
132
133 if self._thread.is_alive():
134 log.warning(
135 "Event loop thread could not be joined, so shutdown may not be clean. "
136 "Please call Cluster.shutdown() to avoid this.")
137
138 log.debug("Event loop thread was joined")
139
140 def add_timer(self, timer):
141 self._timers.add_timer(timer)

Callers 6

clean_global_loopMethod · 0.45
clean_global_loopMethod · 0.45
tearDownMethod · 0.45
_cleanupFunction · 0.45
handle_forkMethod · 0.45

Calls 3

notifyMethod · 0.95
closeMethod · 0.45
stopMethod · 0.45

Tested by 4

clean_global_loopMethod · 0.36
clean_global_loopMethod · 0.36
tearDownMethod · 0.36