Exemple #1
0
 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
Exemple #2
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))
Exemple #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))
Exemple #4
0
 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
Exemple #5
0
    def __del__(self):
        Startable.__del__(self)
        for channel in self._channels:
            del channel

        self.OnConnectionError.clear()
Exemple #6
0
 def _invokeOnStopped(self):
     Startable._invokeOnStopped(self)
     for th in self._thExtractors:
         th.join()
Exemple #7
0
 def _invokeOnStart(self):
     Startable._invokeOnStart(self)
     for th in self._thExtractors:
         th.start()
Exemple #8
0
    def __del__(self):
        Startable.__del__(self)
        for channel in self._channels:
            del channel

        self.OnConnectionError.clear()
Exemple #9
0
 def _invokeOnStopped(self):
     Startable._invokeOnStopped(self)
     for th in self._thExtractors:
         th.join()
Exemple #10
0
 def _invokeOnStart(self):
     Startable._invokeOnStart(self)
     for th in self._thExtractors:
         th.start()