本文整理汇总了Python中zeroless.Client.connect方法的典型用法代码示例。如果您正苦于以下问题:Python Client.connect方法的具体用法?Python Client.connect怎么用?Python Client.connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zeroless.Client
的用法示例。
在下文中一共展示了Client.connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_client_addresses_property
# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import connect [as 别名]
def test_client_addresses_property(self):
client = Client()
addresses = (('10.0.0.1', 1567), ('10.0.0.2', 1568), ('10.0.0.3', 1569))
for ip, port in addresses:
client.connect(ip, port)
assert client.addresses == addresses
示例2: listen_for_pub_with_empty_topic
# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import connect [as 别名]
def listen_for_pub_with_empty_topic():
client = Client()
client.connect(ip='127.0.0.1', port=7895)
return client.sub()
示例3: listen_for_pub_with_embedded_topic
# 需要导入模块: from zeroless import Client [as 别名]
# 或者: from zeroless.Client import connect [as 别名]
def listen_for_pub_with_embedded_topic():
client = Client()
client.connect(ip='127.0.0.1', port=7894)
return client.sub(topics=[b'sh'])