本文整理汇总了Python中pgq.consumer.Consumer.unregister_consumer方法的典型用法代码示例。如果您正苦于以下问题:Python Consumer.unregister_consumer方法的具体用法?Python Consumer.unregister_consumer怎么用?Python Consumer.unregister_consumer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pgq.consumer.Consumer
的用法示例。
在下文中一共展示了Consumer.unregister_consumer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unregister_consumer
# 需要导入模块: from pgq.consumer import Consumer [as 别名]
# 或者: from pgq.consumer.Consumer import unregister_consumer [as 别名]
def unregister_consumer(self):
dst_db = self.get_database(self.target_db)
state = self.get_consumer_state()
src_db = self.get_provider_db(state)
# unregister on provider
Consumer.unregister_consumer(self)
# unregister on subscriber
q = "select * from pgq_node.unregister_consumer(%s, %s)"
self.exec_cmd(dst_db, q, [ self.queue_name, self.consumer_name ])
示例2: unregister_consumer
# 需要导入模块: from pgq.consumer import Consumer [as 别名]
# 或者: from pgq.consumer.Consumer import unregister_consumer [as 别名]
def unregister_consumer(self):
dst_db = self.get_database(self.target_db)
dst_curs = dst_db.cursor()
# fetch provider loc
q = "select * from pgq_node.get_consumer_state(%s, %s)"
rows = self.exec_cmd(dst_db, q, [ self.queue_name, self.consumer_name ])
state = rows[0]
provider_loc = state['provider_location']
# unregister on provider
src_db = self.get_database(PDB, connstr = provider_loc)
src_curs = src_db.cursor()
Consumer.unregister_consumer(self)
# unregister on subscriber
q = "select * from pgq_node.unregister_consumer(%s, %s)"
self.exec_cmd(dst_db, q, [ self.queue_name, self.consumer_name ])
示例3: unregister_consumer
# 需要导入模块: from pgq.consumer import Consumer [as 别名]
# 或者: from pgq.consumer.Consumer import unregister_consumer [as 别名]
def unregister_consumer(self):
"""If unregistering, also clean completed tick table on dest."""
Consumer.unregister_consumer(self)
self.dst_reset()