本文整理汇总了Python中distributed.Worker.data[('x',5)]方法的典型用法代码示例。如果您正苦于以下问题:Python Worker.data[('x',5)]方法的具体用法?Python Worker.data[('x',5)]怎么用?Python Worker.data[('x',5)]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distributed.Worker
的用法示例。
在下文中一共展示了Worker.data[('x',5)]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_add_worker
# 需要导入模块: from distributed import Worker [as 别名]
# 或者: from distributed.Worker import data[('x',5)] [as 别名]
def test_add_worker(s, a, b):
w = Worker(s.ip, s.port, ncores=3, ip='127.0.0.1')
w.data[('x', 5)] = 6
w.data['y'] = 1
yield w._start(8020)
dsk = {('x', i): (inc, i) for i in range(10)}
s.update_graph(dsk=dsk, keys=list(dsk))
s.add_worker(address=w.address, keys=list(w.data),
ncores=w.ncores, nanny_port=w.nanny_port)
for k in w.data:
assert w.address in s.who_has[k]
s.validate(allow_overlap=True)
示例2: test_add_worker
# 需要导入模块: from distributed import Worker [as 别名]
# 或者: from distributed.Worker import data[('x',5)] [as 别名]
def test_add_worker(s, a, b):
w = Worker(s.ip, s.port, ncores=3, ip='127.0.0.1')
w.data[('x', 5)] = 6
w.data['y'] = 1
yield w._start(0)
dsk = {('x', i): (inc, i) for i in range(10)}
s.update_graph(tasks=valmap(dumps_task, dsk), keys=list(dsk), client='client',
dependencies={k: set() for k in dsk})
s.add_worker(address=w.address, keys=list(w.data),
ncores=w.ncores, services=s.services)
for k in w.data:
assert w.address in s.who_has[k]
s.validate(allow_overlap=True)