(self)
| 691 | return batch, feats, stream_event |
| 692 | |
| 693 | def _next_threaded(self): |
| 694 | try: |
| 695 | batch, feats, stream_event, exception = self.queue.get( |
| 696 | timeout=prefetcher_timeout |
| 697 | ) |
| 698 | except Empty: |
| 699 | raise RuntimeError( |
| 700 | f"Prefetcher thread timed out at {prefetcher_timeout} seconds." |
| 701 | ) |
| 702 | if batch is None: |
| 703 | self.thread.join() |
| 704 | if exception is None: |
| 705 | raise StopIteration |
| 706 | exception.reraise() |
| 707 | return batch, feats, stream_event |
| 708 | |
| 709 | def __next__(self): |
| 710 | batch, feats, stream_event = ( |