MCPcopy
hub / github.com/tornadoweb/tornado / notify

Method notify

tornado/locks.py:141–151  ·  view source on GitHub ↗

Wake ``n`` waiters.

(self, n: int = 1)

Source from the content-addressed store, hash-verified

139 return waiter
140
141 def notify(self, n: int = 1) -> None:
142 """Wake ``n`` waiters."""
143 waiters = [] # Waiters we plan to run right now.
144 while n and self._waiters:
145 waiter = self._waiters.popleft()
146 if not waiter.done(): # Might have timed out.
147 n -= 1
148 waiters.append(waiter)
149
150 for waiter in waiters:
151 future_set_result_unless_cancelled(waiter, True)
152
153 def notify_all(self) -> None:
154 """Wake all waiters."""

Callers 10

notify_allMethod · 0.95
test_notify_1Method · 0.95
test_notify_nMethod · 0.95
test_nested_notifyMethod · 0.95
close_callbackMethod · 0.80
_atexit_callbackFunction · 0.80
closeMethod · 0.80
_start_selectMethod · 0.80

Calls 3

appendMethod · 0.80
doneMethod · 0.45

Tested by 6

test_notify_1Method · 0.76
test_notify_nMethod · 0.76
test_nested_notifyMethod · 0.76
close_callbackMethod · 0.64