Subclass of Future which represents a wait for the cancellation of a _WaitHandleFuture using an event.
| 169 | |
| 170 | |
| 171 | class _WaitCancelFuture(_BaseWaitHandleFuture): |
| 172 | """Subclass of Future which represents a wait for the cancellation of a |
| 173 | _WaitHandleFuture using an event. |
| 174 | """ |
| 175 | |
| 176 | def __init__(self, ov, event, wait_handle, *, loop=None): |
| 177 | super().__init__(ov, event, wait_handle, loop=loop) |
| 178 | |
| 179 | self._done_callback = None |
| 180 | |
| 181 | def cancel(self): |
| 182 | raise RuntimeError("_WaitCancelFuture must not be cancelled") |
| 183 | |
| 184 | def set_result(self, result): |
| 185 | super().set_result(result) |
| 186 | if self._done_callback is not None: |
| 187 | self._done_callback(self) |
| 188 | |
| 189 | def set_exception(self, exception): |
| 190 | super().set_exception(exception) |
| 191 | if self._done_callback is not None: |
| 192 | self._done_callback(self) |
| 193 | |
| 194 | |
| 195 | class _WaitHandleFuture(_BaseWaitHandleFuture): |
no outgoing calls
no test coverage detected
searching dependent graphs…