MCPcopy Index your code
hub / github.com/RustPython/RustPython / _AsCompletedWaiter

Class _AsCompletedWaiter

Lib/concurrent/futures/_base.py:74–94  ·  view source on GitHub ↗

Used by as_completed().

Source from the content-addressed store, hash-verified

72 self.finished_futures.append(future)
73
74class _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
96class _FirstCompletedWaiter(_Waiter):
97 """Used by wait(return_when=FIRST_COMPLETED)."""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected