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

Method set

tornado/locks.py:212–222  ·  view source on GitHub ↗

Set the internal flag to ``True``. All waiters are awakened. Calling `.wait` once the flag is set will not block.

(self)

Source from the content-addressed store, hash-verified

210 return self._value
211
212 def set(self) -> None:
213 """Set the internal flag to ``True``. All waiters are awakened.
214
215 Calling `.wait` once the flag is set will not block.
216 """
217 if not self._value:
218 self._value = True
219
220 for fut in self._waiters:
221 if not fut.done():
222 fut.set_result(None)
223
224 def clear(self) -> None:
225 """Reset the internal flag to ``False``.

Callers 15

test_reprMethod · 0.95
test_eventMethod · 0.95
test_event_wait_clearMethod · 0.95
test_connect_timeoutMethod · 0.95
__init__Method · 0.45
task_doneMethod · 0.45
init_serverMethod · 0.45
accept_callbackMethod · 0.45
finishMethod · 0.45
test_connection_closeMethod · 0.45

Calls 1

doneMethod · 0.45

Tested by 15

test_reprMethod · 0.76
test_eventMethod · 0.76
test_event_wait_clearMethod · 0.76
test_connect_timeoutMethod · 0.76
init_serverMethod · 0.36
accept_callbackMethod · 0.36
finishMethod · 0.36
test_connection_closeMethod · 0.36
test_resolve_timeoutMethod · 0.36
native_rootMethod · 0.36