This method should be called by a ManagedThread.
(self, timeout: Optional[float] = None)
| 729 | raise NotImplementedError |
| 730 | |
| 731 | def __call__(self, timeout: Optional[float] = None) -> bool: |
| 732 | ''' This method should be called by a ManagedThread. ''' |
| 733 | timeout = timeout or 0.1 |
| 734 | responses = self.worker.engine.await_responses( |
| 735 | timeout=datetime.timedelta(seconds=timeout)) |
| 736 | # filter since The _engine_response_callback may return None |
| 737 | responses = list( |
| 738 | filter( |
| 739 | lambda _: _, |
| 740 | [self.worker._engine_response_callback(r) for r in responses])) |
| 741 | |
| 742 | # append the error responses to the temp_error_responses |
| 743 | while not self.temp_error_responses.empty(): |
| 744 | responses.append(self.temp_error_responses.get()) |
| 745 | |
| 746 | with nvtx_range_debug(f"await_response-{len(responses)}", |
| 747 | color="red", |
| 748 | category="Worker"): |
| 749 | self.responses_handler(responses) |
| 750 | return True |
| 751 | |
| 752 | def handle_for_worker(self, responses: List[tllm.Response]) -> None: |
| 753 | ''' Return the responses to asyncio.event_loop. ''' |
nothing calls this directly
no test coverage detected