本文整理匯總了Python中system.process_context.ProcessContext.create_pid_file方法的典型用法代碼示例。如果您正苦於以下問題:Python ProcessContext.create_pid_file方法的具體用法?Python ProcessContext.create_pid_file怎麽用?Python ProcessContext.create_pid_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類system.process_context.ProcessContext
的用法示例。
在下文中一共展示了ProcessContext.create_pid_file方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from system.process_context import ProcessContext [as 別名]
# 或者: from system.process_context.ProcessContext import create_pid_file [as 別名]
def __init__(self, process_name):
""" renames process to SynergyYYY and creates PID file """
self.process_name = process_name
self.logger = ProcessContext.get_logger(process_name)
# process-related activities
setproctitle.setproctitle(settings['process_prefix'] + self.process_name)
ProcessContext.create_pid_file(self.process_name)
示例2: __init__
# 需要導入模塊: from system.process_context import ProcessContext [as 別名]
# 或者: from system.process_context.ProcessContext import create_pid_file [as 別名]
def __init__(self, process_name, process_id=None):
""" renames process to SynergyYYY and creates PID file """
self.process_name = process_name
self.process_id = process_id
self.logger = ProcessContext.get_logger(process_name, process_id=self.process_id)
# process-related activities
process_title = settings['process_prefix'] + self.process_name
if self.process_id:
process_title += str(self.process_id)
setproctitle.setproctitle(process_title)
ProcessContext.create_pid_file(self.process_name, process_id=self.process_id)