本文整理汇总了Python中azure.servicebus.ServiceBusService.read_delete_subscription_message方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceBusService.read_delete_subscription_message方法的具体用法?Python ServiceBusService.read_delete_subscription_message怎么用?Python ServiceBusService.read_delete_subscription_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azure.servicebus.ServiceBusService
的用法示例。
在下文中一共展示了ServiceBusService.read_delete_subscription_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HandleMessage
# 需要导入模块: from azure.servicebus import ServiceBusService [as 别名]
# 或者: from azure.servicebus.ServiceBusService import read_delete_subscription_message [as 别名]
from time import time
if __name__ == '__main__':
platform = _config.TARGET_OS
if platform != 'ubuntu' and platform != 'centos':
Logging.Failure('specify \'ubuntu\' or \'centos\' value for property TARGET_OS in analysis_config.json')
else:
Logging.Informative('listening for ' + platform + ' messages')
Logging.Event('StartService', 5)
while True:
try:
# blocks until a message comes in.
msg = _bus_service.read_delete_subscription_message(_config.SERVICE_BUS_TOPIC, platform)
work_start_time = time()
if msg.body:
if HandleMessage(msg):
Logging.Verbose('message handled.')
Logging.Event('Complete', 10)
#Logging.ResetEvents()
work_end_time = time()
Logging.Verbose('Loop completed in ' + str(work_end_time - work_start_time) + ' seconds.')
except Exception as details:
# Log the Logging.Failure, but don't give up!
Logging.Failure('exception: %s' % (details) , 16, False)