本文整理汇总了Python中pyres.worker.Worker.working方法的典型用法代码示例。如果您正苦于以下问题:Python Worker.working方法的具体用法?Python Worker.working怎么用?Python Worker.working使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyres.worker.Worker
的用法示例。
在下文中一共展示了Worker.working方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: working
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import working [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: test_working
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import working [as 别名]
def test_working(self):
worker = Worker(['basic'])
self.resq.enqueue_from_string('tests.Basic','basic','test1')
worker.register_worker()
job = Job.reserve('basic', self.resq)
worker.working_on(job)
name = "%s:%s:%s" % (os.uname()[1],os.getpid(),'basic')
workers = Worker.working(self.resq)
assert len(workers) == 1
assert str(worker) == str(workers[0])
assert worker != workers[0]
示例3: working
# 需要导入模块: from pyres.worker import Worker [as 别名]
# 或者: from pyres.worker.Worker import working [as 别名]
def working(self):
from pyres.worker import Worker
return Worker.working(self)