Ejemplo n.º 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)
     self.OnSendError = EventHook()
     self._mutex = threading.Lock()
     self.OnMessageSent = EventHook()
Ejemplo n.º 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))
Ejemplo n.º 3
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
Ejemplo n.º 4
0
 def __init__(self,
              host="",
              reconnectionTimer=reconnectiontimers.CreateLogarithmicTimer(),
              maxReconnections=MAX_RECONNECTIONS,
              compressor=compressors.DefaultCompressor(),
              useAck=False):
     self._isConnected = False
     self._reconnectionTimer = reconnectionTimer
     self._reconnectionNumber = 0
     self._maxReconnections = maxReconnections
     self.OnConnectionError = EventHook()
     self._host = host
     self._useAck = useAck
     self._compressor = compressor
Ejemplo n.º 5
0
 def __init__(self, queue, channels=list(), numExtractors=4):
     BaseGateway.__init__(self, queue, channels, numExtractors)
     self.OnMessageReceived = EventHook()
Ejemplo n.º 6
0
 def __init__(self):
     self._statemachine = StartableStateMachine()
     self.OnStart = EventHook()
     self.OnStopped = EventHook()
     self._statemachine.OnStart += self._invokeOnStart
     self._statemachine.OnStopped += self._invokeOnStopped
Ejemplo n.º 7
0
 def __init__(self):
     self.OnStart = EventHook()
     self.OnStopped = EventHook()
     StateMachine.__init__(self)