コード例 #1
0
ファイル: basechannels.py プロジェクト: petxo/HermEsb
 def __init__(self, host="", reconnectionTimer=reconnectiontimers.CreateLogarithmicTimer(),
              maxReconnections=Channel.MAX_RECONNECTIONS, compressor=compressors.DefaultCompressor(), useAck=False):
     Channel.__init__(self, host, reconnectionTimer, maxReconnections, compressor, useAck)
     Startable.__init__(self)
     self._thReceive = threading.Thread(target=self.__workReceive)
     self.OnMessageReceived = EventHook()
     self.OnStart += self.__beginReceive
     self.OnStopped += self.__endReceive
コード例 #2
0
ファイル: gateways.py プロジェクト: petxo/HermEsb
    def __init__(self, queue, channels=list(), numExtractors=4):
        Startable.__init__(self)
        self._channels = list()
        self._queue = queue
        self.OnConnectionError = EventHook()
        for channel in channels:
            self.addChannel(channel)

        self._thExtractors = list()
        for count in range(0, numExtractors):
            self._thExtractors.append(threading.Thread(target=self._process_queue))
コード例 #3
0
    def __init__(self, queue, channels=list(), numExtractors=4):
        Startable.__init__(self)
        self._channels = list()
        self._queue = queue
        self.OnConnectionError = EventHook()
        for channel in channels:
            self.addChannel(channel)

        self._thExtractors = list()
        for count in range(0, numExtractors):
            self._thExtractors.append(
                threading.Thread(target=self._process_queue))
コード例 #4
0
ファイル: basechannels.py プロジェクト: yashhotline/HermEsb
 def __init__(self,
              host="",
              reconnectionTimer=reconnectiontimers.CreateLogarithmicTimer(),
              maxReconnections=Channel.MAX_RECONNECTIONS,
              compressor=compressors.DefaultCompressor(),
              useAck=False):
     Channel.__init__(self, host, reconnectionTimer, maxReconnections,
                      compressor, useAck)
     Startable.__init__(self)
     self._thReceive = threading.Thread(target=self.__workReceive)
     self.OnMessageReceived = EventHook()
     self.OnStart += self.__beginReceive
     self.OnStopped += self.__endReceive
コード例 #5
0
    def __del__(self):
        Startable.__del__(self)
        for channel in self._channels:
            del channel

        self.OnConnectionError.clear()
コード例 #6
0
 def _invokeOnStopped(self):
     Startable._invokeOnStopped(self)
     for th in self._thExtractors:
         th.join()
コード例 #7
0
 def _invokeOnStart(self):
     Startable._invokeOnStart(self)
     for th in self._thExtractors:
         th.start()
コード例 #8
0
ファイル: gateways.py プロジェクト: petxo/HermEsb
    def __del__(self):
        Startable.__del__(self)
        for channel in self._channels:
            del channel

        self.OnConnectionError.clear()
コード例 #9
0
ファイル: gateways.py プロジェクト: petxo/HermEsb
 def _invokeOnStopped(self):
     Startable._invokeOnStopped(self)
     for th in self._thExtractors:
         th.join()
コード例 #10
0
ファイル: gateways.py プロジェクト: petxo/HermEsb
 def _invokeOnStart(self):
     Startable._invokeOnStart(self)
     for th in self._thExtractors:
         th.start()