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

Method maybe_start

cassandra/io/asyncorereactor.py:232–247  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

230 self._loop_dispatcher = dispatcher
231
232 def maybe_start(self):
233 should_start = False
234 did_acquire = False
235 try:
236 did_acquire = self._loop_lock.acquire(False)
237 if did_acquire and not self._started:
238 self._started = True
239 should_start = True
240 finally:
241 if did_acquire:
242 self._loop_lock.release()
243
244 if should_start:
245 self._thread = Thread(target=self._run_loop, name="asyncore_cassandra_driver_event_loop")
246 self._thread.daemon = True
247 self._thread.start()
248
249 def wake_loop(self):
250 self._loop_dispatcher.notify_loop()

Callers 1

__init__Method · 0.45

Calls 1

startMethod · 0.45

Tested by

no test coverage detected