本文整理汇总了Python中mpx.service.subscription_manager.SUBSCRIPTION_MANAGER.diag_get_sids方法的典型用法代码示例。如果您正苦于以下问题:Python SUBSCRIPTION_MANAGER.diag_get_sids方法的具体用法?Python SUBSCRIPTION_MANAGER.diag_get_sids怎么用?Python SUBSCRIPTION_MANAGER.diag_get_sids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpx.service.subscription_manager.SUBSCRIPTION_MANAGER
的用法示例。
在下文中一共展示了SUBSCRIPTION_MANAGER.diag_get_sids方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_timeout
# 需要导入模块: from mpx.service.subscription_manager import SUBSCRIPTION_MANAGER [as 别名]
# 或者: from mpx.service.subscription_manager.SUBSCRIPTION_MANAGER import diag_get_sids [as 别名]
def test_timeout(self):
sids = []
for i in range(2):
if not i:
timeout = 1.0
else:
timeout = None
# ID3 is /services/time/UTC/milliseconds which should
# change "really fast."
sid = SUBSCRIPTION_MANAGER.create_polled({self.ID3:self.ID3},
timeout)
# Make sure it comes up.
t1 = time.time()
self.__values_changing(sid)
sids.append(sid)
# Double check the values are changing and that the subscriptions
# stay valid while we poll for values.
t1 = time.time()
while (time.time() - t1) < 2.0:
for sid in sids:
self.__values_changing(sid)
time.sleep(0.1)
# Now ensure that sid[0] times out...
sid = sids.pop(0)
t1 = time.time()
while sid in SUBSCRIPTION_MANAGER.diag_get_sids():
if (time.time()-t1) > 2.0:
raise "%r did not timeout." % sid
time.sleep(0.1)
# Finally, make sure that the other subscription is valid.
sid = sids.pop(0)
self.__values_changing(sid)
return
示例2: _print_sids
# 需要导入模块: from mpx.service.subscription_manager import SUBSCRIPTION_MANAGER [as 别名]
# 或者: from mpx.service.subscription_manager.SUBSCRIPTION_MANAGER import diag_get_sids [as 别名]
def _print_sids(self):
print ""
print "*"*60
for s in SUBSCRIPTION_MANAGER.diag_get_sids():
print s
print "*"*60
return