Used by as_completed().
| 72 | self.finished_futures.append(future) |
| 73 | |
| 74 | class _AsCompletedWaiter(_Waiter): |
| 75 | """Used by as_completed().""" |
| 76 | |
| 77 | def __init__(self): |
| 78 | super(_AsCompletedWaiter, self).__init__() |
| 79 | self.lock = threading.Lock() |
| 80 | |
| 81 | def add_result(self, future): |
| 82 | with self.lock: |
| 83 | super(_AsCompletedWaiter, self).add_result(future) |
| 84 | self.event.set() |
| 85 | |
| 86 | def add_exception(self, future): |
| 87 | with self.lock: |
| 88 | super(_AsCompletedWaiter, self).add_exception(future) |
| 89 | self.event.set() |
| 90 | |
| 91 | def add_cancelled(self, future): |
| 92 | with self.lock: |
| 93 | super(_AsCompletedWaiter, self).add_cancelled(future) |
| 94 | self.event.set() |
| 95 | |
| 96 | class _FirstCompletedWaiter(_Waiter): |
| 97 | """Used by wait(return_when=FIRST_COMPLETED).""" |
no outgoing calls
no test coverage detected