| 524 | ) |
| 525 | |
| 526 | def send_request(self, command, arguments=None, proceed=True): |
| 527 | self.before_request(command, arguments) |
| 528 | |
| 529 | if self.timeline.is_frozen and proceed: |
| 530 | self.proceed() |
| 531 | |
| 532 | if command in ("launch", "attach"): |
| 533 | self.start_command = command |
| 534 | |
| 535 | message = self.channel.send_request(command, arguments) |
| 536 | request = self.timeline.record_request(message) |
| 537 | |
| 538 | if command in ("launch", "attach"): |
| 539 | self.start_request = request |
| 540 | |
| 541 | # Register callback after recording the request, so that there's no race |
| 542 | # between it being recorded, and the response to it being received. |
| 543 | message.on_response(lambda response: self._process_response(request, response)) |
| 544 | |
| 545 | return request |
| 546 | |
| 547 | def _process_event(self, event): |
| 548 | occ = self.timeline.record_event(event, block=False) |