本文整理汇总了Python中twisted.internet.protocol.ReconnectingClientFactory.forProtocol方法的典型用法代码示例。如果您正苦于以下问题:Python ReconnectingClientFactory.forProtocol方法的具体用法?Python ReconnectingClientFactory.forProtocol怎么用?Python ReconnectingClientFactory.forProtocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.protocol.ReconnectingClientFactory
的用法示例。
在下文中一共展示了ReconnectingClientFactory.forProtocol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import forProtocol [as 别名]
def __init__(self):
MultiService.__init__(self)
convergence_loop = build_convergence_loop_fsm(
self.reactor, self.deployer
)
self.logger = convergence_loop.logger
self.cluster_status = build_cluster_status_fsm(convergence_loop)
self.factory = ReconnectingClientFactory.forProtocol(
lambda: AgentAMP(self))
示例2: __init__
# 需要导入模块: from twisted.internet.protocol import ReconnectingClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ReconnectingClientFactory import forProtocol [as 别名]
def __init__(self, context_factory):
"""
:param context_factory: TLS context factory for the AMP client.
"""
MultiService.__init__(self)
convergence_loop = build_convergence_loop_fsm(self.reactor, self.deployer)
self.logger = convergence_loop.logger
self.cluster_status = build_cluster_status_fsm(convergence_loop)
self.reconnecting_factory = ReconnectingClientFactory.forProtocol(lambda: AgentAMP(self.reactor, self))
self.factory = TLSMemoryBIOFactory(context_factory, True, self.reconnecting_factory)