当前位置: 首页>>代码示例>>Python>>正文


Python ServiceBusService.read_delete_subscription_message方法代码示例

本文整理汇总了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)
开发者ID:adityamandaleeka,项目名称:dotnet-reliability,代码行数:32,代码来源:analysis_worker.py


注:本文中的azure.servicebus.ServiceBusService.read_delete_subscription_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。