MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _wake_up_first

Method _wake_up_first

pymongo/_asyncio_lock.py:165–176  ·  view source on GitHub ↗

Ensure that the first waiter will wake up.

(self)

Source from the content-addressed store, hash-verified

163 raise RuntimeError("Lock is not acquired")
164
165 def _wake_up_first(self) -> None:
166 """Ensure that the first waiter will wake up."""
167 if not self._waiters:
168 return
169 try:
170 fut = next(iter(self._waiters))
171 except StopIteration:
172 return
173
174 # .done() means that the waiter is already set to wake up.
175 if not fut.done():
176 fut.set_result(True)
177
178
179class Condition(_ContextManagerMixin, _LoopBoundMixin):

Callers 2

acquireMethod · 0.95
releaseMethod · 0.95

Calls 2

nextFunction · 0.85
iterFunction · 0.85

Tested by

no test coverage detected