示例#1
0
    def __init__(self):
        self._log_Q = Queue()
        self._log_worker = LogMsgWorker(self._log_Q)

        self._event_Q = Queue()
        self._event_worker = EventMsgWorker(self._event_Q)

        manager = OMQSLogManager(name=__name__, file_name='OMQSManager')
        self._logger = manager.logger
示例#2
0
class OMQSManager(object):

    def __init__(self):
        self._log_Q = Queue()
        self._log_worker = LogMsgWorker(self._log_Q)

        self._event_Q = Queue()
        self._event_worker = EventMsgWorker(self._event_Q)

        manager = OMQSLogManager(name=__name__, file_name='OMQSManager')
        self._logger = manager.logger

    def run(self):
        self._logger.info('[OMQSManager] Starting the worker...')
        try:
            self._log_worker.start()
            self._event_worker.start()
            self.wait_worker(self._event_worker)

        except Exception, e:
            self._logger.error('[OMQSManager] Failed to start the worker: %s', str(e))