def compute_worker_run_info_generator(
        self, scheduled_run_id: str
    ) -> Iterator[ComputeWorkerRunInfo]:
        """Pulls information about a Lightly Worker run continuously.

        Polls the Lightly Worker status every 30s.
        If the status changed, an update pops up.
        If the Lightly Worker run finished, the generator stops.

        Args:
            scheduled_run_id:
                The id with which the run was scheduled.

        Returns:
            Generator of information about the Lightly Worker run status.

        Examples:
            >>> # Scheduled a Lightly Worker run and monitor its state
            >>> scheduled_run_id = client.schedule_compute_worker_run(...)
            >>> for run_info in client.compute_worker_run_info_generator(scheduled_run_id):
            >>>     print(f"Lightly Worker run is now in state='{run_info.state}' with message='{run_info.message}'")
            >>>

        """
        last_run_info = None
        while True:
            run_info = self.get_compute_worker_run_info(
                scheduled_run_id=scheduled_run_id
            )

            # Only yield new run_info
            if run_info != last_run_info:
                yield run_info

            # Break if the scheduled run is in one of the end states.
            if run_info.in_end_state():
                break

            # Wait before polling the state again
            time.sleep(30)  # Keep this at 30s or larger to prevent rate limiting.

            last_run_info = run_info
Pulls information about a Lightly Worker run continuously.

        Polls the Lightly Worker status every 30s.
        If the status changed, an update pops up.
        If the Lightly Worker run finished, the generator stops.

        Args:
            scheduled_run_id:
                The id with which the run was scheduled.

        Returns:
            Generator of information about the Lightly Worker run status.

        Examples:
            >>> # Scheduled a Lightly Worker run and monitor its state
            >>> scheduled_run_id = client.schedule_compute_worker_run(...)
            >>> for run_info in client.compute_worker_run_info_generator(scheduled_run_id):
            >>>     print(f"Lightly Worker run is now in state='{run_info.state}' with message='{run_info.message}'")
            >>>

        
lightly/api/api_workflow_compute_worker.py