本文整理汇总了Python中txamqp.protocol.AMQClient.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python AMQClient.__init__方法的具体用法?Python AMQClient.__init__怎么用?Python AMQClient.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类txamqp.protocol.AMQClient
的用法示例。
在下文中一共展示了AMQClient.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
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: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
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: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
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: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
def __init__(self, dispatcher, username='guest', password='guest',
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)
示例5: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
def __init__(self, *args, **kwargs):
AMQClient.__init__(self, *args, **kwargs)
self.factory = None
self.logTraffic = False
示例6: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
def __init__(self, connected_callback, *args, **kwargs):
AMQClient.__init__(self, *args, **kwargs)
self.connected_callback = connected_callback
示例7: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
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
示例8: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
def __init__(self, *args, **kwargs):
self.lock = defer.DeferredLock()
AMQClient.__init__(self, *args, **kwargs)
示例9: __init__
# 需要导入模块: from txamqp.protocol import AMQClient [as 别名]
# 或者: from txamqp.protocol.AMQClient import __init__ [as 别名]
def __init__(self, delegate, vhost, spec, prefetch_count):
AMQClient.__init__(self, delegate, vhost, spec)
self.prefetch_count = prefetch_count