def asdict(self):
        """Retrieve all attributes as a dictionary."""
        if self.cache and self._cached_asdict is not None:
            return self._cached_asdict
        d = self._get_nosync()
        if self.cache:
            self._cached_asdict = d
        return d
Retrieve all attributes as a dictionary.