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

Method record_done

tornado/test/locks_test.py:28–38  ·  view source on GitHub ↗

Record the resolution of a Future returned by Condition.wait.

(self, future, key)

Source from the content-addressed store, hash-verified

26 self.history = [] # type: typing.List[typing.Union[int, str]]
27
28 def record_done(self, future, key):
29 """Record the resolution of a Future returned by Condition.wait."""
30
31 def callback(_):
32 if not future.result():
33 # wait() resolved to False, meaning it timed out.
34 self.history.append("timeout")
35 else:
36 self.history.append(key)
37
38 future.add_done_callback(callback)
39
40 def loop_briefly(self):
41 """Run all queued callbacks on the IOLoop.

Callers 5

test_notify_1Method · 0.95
test_notify_nMethod · 0.95
test_notify_allMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected