File indexing completed on 2026-04-19 08:00:04
0001 import threading
0002
0003 from pandaharvester.harvestercore import core_utils
0004
0005 from .dummy_submitter import DummySubmitter
0006
0007
0008 baseLogger = core_utils.setup_logger("dummy_singleton_submitter")
0009
0010
0011
0012 class DummySingletonSubmitter(object):
0013 instances = dict()
0014 lock = threading.Lock()
0015
0016
0017 def __init__(self, **kwarg):
0018 key = kwarg["queueName"]
0019 cls = self.__class__
0020 with cls.lock:
0021 if key not in cls.instances:
0022 instance = DummySubmitter(**kwarg)
0023 cls.instances[key] = instance
0024 self.key = key
0025
0026 def __getattr__(self, name):
0027 cls = self.__class__
0028 return getattr(cls.instances[self.key], name)