| 220 | self.asyncio_loop.stop() |
| 221 | |
| 222 | def call_at( |
| 223 | self, when: float, callback: Callable, *args: Any, **kwargs: Any |
| 224 | ) -> object: |
| 225 | # asyncio.call_at supports *args but not **kwargs, so bind them here. |
| 226 | # We do not synchronize self.time and asyncio_loop.time, so |
| 227 | # convert from absolute to relative. |
| 228 | return self.asyncio_loop.call_later( |
| 229 | max(0, when - self.time()), |
| 230 | self._run_callback, |
| 231 | functools.partial(callback, *args, **kwargs), |
| 232 | ) |
| 233 | |
| 234 | def remove_timeout(self, timeout: object) -> None: |
| 235 | timeout.cancel() # type: ignore |