Exemplo n.º 1
0
    def __init__(self):

        self.queue = 'ModbusPlugin-TCP'

        self.mq_serv = MsgQueueService('test_queue')
        self.mq_serv.set_callback(self._recv)
        self.mq_serv.start(daemon=True)
Exemplo n.º 2
0
    def __init__(self, credential=None):
        self.name = 'opcua'
        self.data_callback = None
        self.event_callback = None

        if credential is None:
            self.config = ConfigLoader()
        else:
            self.config = ConfigLoader(credential)

        self.configdict = self.config.ConfigSectionMap('Amqp')
        self.mq_serv = MsgQueueService(
            self.name,
            self.configdict['url'],
            threading.Lock(),
            tls_config=UaAmqpSecurity().get_tls_confg())
Exemplo n.º 3
0
    def __init__(self, entity, config):
        self.name = entity.plugin_name
        self.thread_monitor = None
        self.monitor_wait = 1.0
        self.monitor_finish_evt = threading.Event()
        # Use threading.Event for further potential event trigger usage
        self.sigterm = threading.Event()
        self.entity = entity
        self.config = config
        self.methods = self.entity.get_methods()

        url = None
        if self.config.fetch_mq_env():
            url = self.config.fetch_mq_env()['url']

        self.mq_serv = MsgQueueService(
            self.name,
            url=url,
            req_lock=threading.Lock(),
            tls_config=self.config.fetch_security_env())
        LogService.initialize(**(self.config.fetch_logger_env() or {}))