def stop(self):
        """
        Stops listener if it's still running.

        If listener is already stopped, a ``ValueError`` will be raised

        """
        if not self.is_running():
            raise ValueError("Listener is not running")

        self.__scheduler__.cancel_job(self.__listener_job__)
        self.__listener_job__ = None
        self.__current_thread__.stop()
        self.__current_thread__.join()  # TODO: improve it!

        Stops listener if it's still running.

        If listener is already stopped, a ``ValueError`` will be raised

        
argilla-v1/src/argilla_v1/listeners/listener.py