def __init__(self, slots_handler: 'SlotsHandler') -> None:
        """Create and start a new thread for handling slot advance queries.

        :param slots_handler: The calling class instance for reference to slot information attributes.
        """
        super().__init__()
        self.daemon = True
        self._slots_handler = slots_handler

        # _copy_slots and _failed are used to asynchronously give some feedback to the main thread
        self._copy_slots: List[str] = []
        self._failed = False
        # {'dbname1': {'slot1': 100, 'slot2': 100}, 'dbname2': {'slot3': 100}}
        self._scheduled: Dict[str, Dict[str, int]] = defaultdict(dict)
        self._condition = Condition()  # protect self._scheduled from concurrent access and to wakeup the run() method

        self.start()
Create and start a new thread for handling slot advance queries.

        :param slots_handler: The calling class instance for reference to slot information attributes.
        
patroni/postgresql/slots.py