async def get_entities(self) -> AsyncGenerator[T, None]:
        """Get entities one at a time from the queue.

        Yields entities as they become available, allowing consumer to process
        at its own pace.
        """
        if not self.producer_task:
            await self.start()

        while True:
            # Get next item from queue, if available
            item = await self.queue.get()
            self.queue.task_done()

            # None is our sentinel value for end of stream
            if item is None:
                # Check if the producer failed before yielding any items
                if self.producer_exception:
                    self.logger.error("Producer failed with error before yielding any items")
                    raise self.producer_exception
                break

            yield item

            # Check if producer had an error after yielding the item
            if self.producer_exception:
                self.logger.error("Producer encountered an error, stopping consumer")
                raise self.producer_exception
Get entities one at a time from the queue.

        Yields entities as they become available, allowing consumer to process
        at its own pace.
        
backend/airweave/platform/sync/stream.py