(self, fn)
| 72 | return None |
| 73 | |
| 74 | def add_done_callback(self, fn): |
| 75 | run = False |
| 76 | with self._lock: |
| 77 | if self._done: |
| 78 | run = True |
| 79 | else: |
| 80 | self._callbacks.append(fn) |
| 81 | if run: |
| 82 | try: |
| 83 | fn(self) |
| 84 | except: |
| 85 | # TODO(benh): Log if Exception, but semantics tell |
| 86 | # us to ignore regardless. |
| 87 | pass |
| 88 | |
| 89 | def set_result(self, result): |
| 90 | with self._lock: |