INNER CODE UNIT · Python
__iter__
bkbilly/lnxlink · lnxlink/__main__.py:43
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."""
coalesce = kwargs.get("coalesce", True)
with self._condition:
key = name
if not coalesce: