本文整理汇总了Python中pyres.worker.Worker.all方法的典型用法代码示例。如果您正苦于以下问题:Python Worker.all方法的具体用法?Python Worker.all怎么用?Python Worker.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyres.worker.Worker
的用法示例。
在下文中一共展示了Worker.all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: working
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def working(request):
workers = Worker.working(resq._server)
template = env.get_template('working.html')
dic = {
'all_workers':Worker.all(HOST),
'workers':workers,
'resq': resq
}
return str(template.render(dic))
示例2: workers
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def workers(self):
workers = []
for w in Wrkr.all(self.resq):
data = w.processing()
host, pid, queues = str(w).split(':')
item = {'state':w.state(),
'host':host,
'pid':pid,
'w':w,
'queues':queues.split(','),
'queue':w.job().get('queue')}
if 'queue' in data:
item['data'] = True
item['code'] = data['payload']['class']
item['runat'] = datetime.datetime.fromtimestamp(float(data['run_at']))
workers.append(WebContainer(**item))
return workers
示例3: workers
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def workers(self):
from pyres.worker import Worker
return Worker.all(self)
示例4: all
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def all(self):
return Wrkr.all(self.resq)
示例5: total_workers
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def total_workers(self):
return str(len(Wrkr.all(self.resq)))
示例6: workers
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def workers(request):
context = {
'workers': Worker.all(HOST)
}
template = env.get_template('workers.html')
return str(template.render(context))
示例7: all_workers
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import all [as 别名]
def all_workers(self):
return Wrkr.all(self.resq)