[BUG] Logic at startup missing
blythed opened this issue · comments
blythed commented
When we load superduper
the queue should be initialized with existing Listener
instances.
This logic is missing.
class LocalSequentialQueue:
"""
LocalSequentialQueue for handling publisher and consumer process.
Local queue which holds listeners, vector indices as queue which
consists of events to be consumed by the corresponding components.
"""
def __init__(self):
self.queue = {}
self.components = {} # --> should be prepopulated
self._db = None
self._component_map = {}
def declare_component(self, component):
"""Declare component and add it to queue."""
identifier = f'{component.type_id}.{component.identifier}'
self.queue[identifier] = []
self.components[identifier] = component
JieguangZhou commented
It would be better to load the queue dynamically. Initialize the queue only when the corresponding event is received and the corresponding component does not exist.
WDYT? @blythed