def shutdown_producer(self) -> None:
        """
        Signal the producer to stop and drain any remaining items from the work_queue.

        This method sets an internal event, `_shutdown_producer`, which tells the
        producer that it should stop adding items to the queue. To ensure that the
        producer notices this signal promptly, we also attempt to drain any items
        currently in the queue, clearing it so that the event can be checked without
        delay.
        """
        self._shutdown_producer.set()
        q = self.work_queue
        while not q.empty():
            q.get_nowait()
            q.task_done()

        Signal the producer to stop and drain any remaining items from the work_queue.

        This method sets an internal event, `_shutdown_producer`, which tells the
        producer that it should stop adding items to the queue. To ensure that the
        producer notices this signal promptly, we also attempt to drain any items
        currently in the queue, clearing it so that the event can be checked without
        delay.
        
src/datachain/asyn.py