INNER CODE UNIT · Python

__repr__

bkbilly/lnxlink · lnxlink/__main__.py:39

    def __repr__(self):
        """Returns a string representation of the queue."""
        return f"<{self.__class__.__name__} queue: {repr(self.queue)}>"

    def __iter__(self):
        """Returns an iterator that yields and removes items from the queue in FIFO order"""
        with self._condition:
            remaining = len(self.queue)
        for _ in range(remaining):
            with self._condition:
                if not self.queue:
                    break
                _, item = self.queue.popitem(last=False)
            name, value, retain, force_publish = item
            yield name, (value, retain, force_publish)

    def add_item(self, name, value, retain=True, force_publish=False, **kwargs):
        """Add an item, replacing its named predecessor unless coalescing is off."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…