本文整理汇总了Python中pika.adapters.base_connection.BaseConnection.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseConnection.__init__方法的具体用法?Python BaseConnection.__init__怎么用?Python BaseConnection.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pika.adapters.base_connection.BaseConnection
的用法示例。
在下文中一共展示了BaseConnection.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters=None, on_open_callback=None,
reconnection_strategy=None):
# Validate we have Tornado installed
if not IOLoop:
raise ImportError("Tornado not installed")
BaseConnection.__init__(self, parameters, on_open_callback,
reconnection_strategy)
示例2: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters=None, on_open_callback=None,
reconnection_strategy=None, io_loop=None):
# Validate we have Tornado installed
if not IOLoop:
raise ImportError("Tornado not installed")
# Store the passed in io_loop (for example, for unit tests)
self.tornado_loop = io_loop
BaseConnection.__init__(self, parameters, on_open_callback,
reconnection_strategy)
示例3: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters=None,
on_open_callback=None,
reconnection_strategy=None,
callback_interval=250,
io_loop=None):
# Validate we have Tornado installed
if not IOLoop:
raise ImportError("Tornado not installed")
self.callback_interval = callback_interval
self._pc = None
self._default_ioloop = io_loop or IOLoop.instance()
BaseConnection.__init__(self, parameters, on_open_callback,
reconnection_strategy)
示例4: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters=None,
on_open_callback=None,
reconnection_strategy=None,
callback_interval=250,
io_loop=None):
# Validate we have Tornado installed
if not IOLoop:
raise ImportError("Tornado not installed")
self.callback_interval = callback_interval
self._pc = None
self._default_ioloop = io_loop or IOLoop.instance()
on_open_callback = stack_context.wrap(on_open_callback)
with stack_context.StackContext(self._stack_context):
BaseConnection.__init__(self, parameters, on_open_callback,
reconnection_strategy, CallbackManager())
示例5: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters):
self.ready = defer.Deferred()
BaseConnection.__init__(self, parameters, self.connectionReady)
self.ioloop = IOLoopReactorAdapter(self, reactor)
示例6: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters=None, on_open_callback=None,
reconnection_strategy=None):
# Run our base connection init
BaseConnection.__init__(self, parameters, on_open_callback,
reconnection_strategy)
示例7: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters=None, on_open_callback=None, reconnection_strategy=None):
# Setup the IOLoop
self.ioloop = IOLoop.instance()
# Run our base connection init
BaseConnection.__init__(self, parameters, on_open_callback, reconnection_strategy)
示例8: __init__
# 需要导入模块: from pika.adapters.base_connection import BaseConnection [as 别名]
# 或者: from pika.adapters.base_connection.BaseConnection import __init__ [as 别名]
def __init__(self, parameters):
self.ready = defer.Deferred()
BaseConnection.__init__(self, parameters, self.connectionReady)