MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / notify

Method notify

pymongo/_asyncio_lock.py:277–291  ·  view source on GitHub ↗

By default, wake up one task waiting on this condition, if any. If the calling task has not acquired the lock when this method is called, a RuntimeError is raised. This method wakes up n of the tasks waiting for the condition variable; if fewer than n are waiting, t

(self, n: int = 1)

Source from the content-addressed store, hash-verified

275 return result
276
277 def notify(self, n: int = 1) -> None:
278 """By default, wake up one task waiting on this condition, if any.
279 If the calling task has not acquired the lock when this method
280 is called, a RuntimeError is raised.
281
282 This method wakes up n of the tasks waiting for the condition
283 variable; if fewer than n are waiting, they are all awoken.
284
285 Note: an awakened task does not actually return from its
286 wait() call until it can reacquire the lock. Since notify() does
287 not release the lock, its caller should.
288 """
289 if not self.locked():
290 raise RuntimeError("cannot notify on un-acquired lock")
291 self._notify(n)
292
293 def _notify(self, n: int) -> None:
294 idx = 0

Callers 15

notify_allMethod · 0.95
scheduleMethod · 0.80
stopMethod · 0.80
test_waitMethod · 0.80
test_wait_forMethod · 0.80
test_notifyMethod · 0.80
test_cancelled_wakeupMethod · 0.80
scheduleMethod · 0.80

Calls 2

_notifyMethod · 0.95
lockedMethod · 0.80

Tested by 8

test_waitMethod · 0.64
test_wait_forMethod · 0.64
test_notifyMethod · 0.64
test_cancelled_wakeupMethod · 0.64