docs: def add_handler(self, message_type, handler):
          """Manage callbacks for message handlers."""
          if message_type not in self._handlers:
              self._handlers[message_type] = []
  
          if handler not in self._handlers[message_type]:
              self._handlers[message_type].append(handler)