예제 #1
0
 def __init__(self, *args, **kwargs):
     print 'init protocol'
     self._stop = False
     # callback on authenticated
     self._auth_succ = Deferred()
     # callback on read_channel opened
     self._read_opened = Deferred()
     # callback on write_channel opened
     self._write_opened = Deferred()
     # callback on read_loop started
     self._read_loop_started = Deferred()
     # callback on shutdown read loop
     self._read_loop_down = Deferred()
     # read queue timeout
     self.q_timeout = 1
     # read loop call
     self._rloop_call = None
     self._sloop_call = None
     self.read_queue = None
     self.read_chan = None
     kwargs['heartbeat'] = kwargs.get('heartbeat', 10)
     # failure traps
     #self.log.warning('AUTO SHUTDOWN 15 sec')
     #reactor.callLater(15, lambda _: self.shutdown_protocol(), (None,))
     self.__messages = set()
     AMQClient.__init__(self, *args, **kwargs)
예제 #2
0
 def __init__(self, *args, **kwargs):
     self.log.debug('init protocol')
     self._stop = False
     # callback on authenticated
     self._auth_succ = Deferred()
     # callback on read_channel opened
     self._read_opened = Deferred()
     # callback on write_channel opened
     self._write_opened = Deferred()
     # callback on read_loop started
     self._read_loop_started = Deferred()
     # callback on shutdown read loop
     self._read_loop_down = Deferred()
     # read queue timeout
     self.q_timeout = 1
     # read loop call
     self._rloop_call = None
     self._sloop_call = None
     # ensure that we start read loop only once
     self._read_loop_enabled = False
     self.read_queue = None
     self.read_chan = None
     kwargs['heartbeat'] = kwargs.get('heartbeat', 10)
     self.__messages = set()
     AMQClient.__init__(self, *args, **kwargs)
예제 #3
0
    def __init__(self, *args, **kwargs):
        AMQClient.__init__(self, *args, **kwargs)

        if self.check_0_8():
            self.replyToField = "reply to"
        else:
            self.replyToField = "reply-to"

        self.thriftBasicReturnQueueLock = defer.DeferredLock()
        self.thriftBasicReturnQueues = {}
예제 #4
0
    def __init__(self, host, port, login, password, vhost, spec):
        self.host = host
        self.port = port
        self.login = login
        self.password = password
        self.vhost = vhost
        self.spec = spec

        AMQClient.__init__(self,
                           delegate=TwistedDelegate(),
                           vhost=vhost,
                           spec=txamqp.spec.load(spec))
예제 #5
0
파일: rabbitmq.py 프로젝트: mailgun/udplog
    def __init__(self, dispatcher, username='******', password='******',
                       vhost='/', exchange='logs', queueSize=None):
        self.dispatcher = dispatcher
        self.username = username
        self.password = password
        self.exchange = exchange
        self.queueSize = queueSize

        self.chan = None

        specDir = FilePath(__file__).parent()
        specFilePath = specDir.child('amqp0-9-1.extended.xml')
        spec = txamqp.spec.load(specFilePath.path)

        delegate = TwistedDelegate()
        AMQClient.__init__(self, delegate=delegate, vhost=vhost,
                                 spec=spec)
예제 #6
0
    def __init__(self,
                 dispatcher,
                 username='******',
                 password='******',
                 vhost='/',
                 exchange='logs',
                 queueSize=None):
        self.dispatcher = dispatcher
        self.username = username
        self.password = password
        self.exchange = exchange
        self.queueSize = queueSize

        self.chan = None

        specDir = FilePath(__file__).parent()
        specFilePath = specDir.child('amqp0-9-1.extended.xml')
        spec = txamqp.spec.load(specFilePath.path)

        delegate = TwistedDelegate()
        AMQClient.__init__(self, delegate=delegate, vhost=vhost, spec=spec)
예제 #7
0
파일: amqp.py 프로젝트: vigilo/connector
 def __init__(self, *args, **kwargs):
     AMQClient.__init__(self, *args, **kwargs)
     self.factory = None
     self.logTraffic = False
예제 #8
0
 def __init__(self, connected_callback, *args, **kwargs):
     AMQClient.__init__(self, *args, **kwargs)
     self.connected_callback = connected_callback
예제 #9
0
 def __init__(self, delegate, vhost, spec, prefetch_count, heartbeat, clock, insist):
     AMQClient.__init__(self, delegate, vhost, spec, heartbeat, clock, insist)
     self.prefetch_count = prefetch_count
예제 #10
0
 def __init__(self, connected_callback, *args, **kwargs):
     AMQClient.__init__(self, *args, **kwargs)
     self.connected_callback = connected_callback
예제 #11
0
 def __init__(self, *args, **kwargs):
     self.lock = defer.DeferredLock()
     AMQClient.__init__(self, *args, **kwargs)
예제 #12
0
 def __init__(self, delegate, vhost, spec, prefetch_count):
     AMQClient.__init__(self, delegate, vhost, spec)
     self.prefetch_count = prefetch_count