Record the resolution of a Future returned by Condition.wait.
(self, future, key)
| 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. |
no outgoing calls
no test coverage detected