Continue processing events after being paused. The tricky part here is that events in the event queue may trigger commands which again pause the execution, so we may not be able to process the entire queue.
(self, event: events.CommandCompleted)
| 222 | return |
| 223 | |
| 224 | def __continue(self, event: events.CommandCompleted): |
| 225 | """ |
| 226 | Continue processing events after being paused. |
| 227 | The tricky part here is that events in the event queue may trigger commands which again pause the execution, |
| 228 | so we may not be able to process the entire queue. |
| 229 | """ |
| 230 | assert self._paused is not None |
| 231 | command_generator = self._paused.generator |
| 232 | self._paused = None |
| 233 | yield from self.__process(command_generator, event.reply) |
| 234 | |
| 235 | while not self._paused and self._paused_event_queue: |
| 236 | ev = self._paused_event_queue.popleft() |
| 237 | if self.debug is not None: |
| 238 | yield self.__debug(f"!> {ev}") |
| 239 | command_generator = self._handle_event(ev) |
| 240 | yield from self.__process(command_generator) |
| 241 | |
| 242 | |
| 243 | mevents = ( |
no test coverage detected