我正在使用芹菜軟件升級系統。我有一個用例,我正在努力實現乾淨。這裏是我的工作:在芹菜結合工作結果
device_software_updates(DEVICE_ID)
returns a list of software updates that need to be installed on a device
installed_device_software(DEVICE_ID)
returns the software modules that are currently installed on a device
latest_device_software(DEVICE_ID)
returns the latest software versions available for a device
software_updates(installed_software,latest_software)
returns the latest software modules that are not installed
純Python,device_software_updates的實現可能看起來像
def device_software_updates(device_id):
return software_updates(installed_device_software(device_id),
latest_device_software(device_id))
什麼是芹菜實現這個最徹底的方法3.0?我想用團體做些事情。我當前的實現看起來是這樣的:
def device_software_updates(device_id):
return (
group(installed_device_software.s(device_id),
latest_device_software.s(device_id)) |
software_updates.s()
)()
不幸的是,這意味着software_updates的argspec是software_updates(arg_list)
這是不理想的。
你永遠不應該從任務內部調用result.get(),您可能會遇到死鎖。 http://celery.readthedocs.org/en/latest/_modules/celery/result.html。 – rajat
@rajat你能提供一個正確的例子嗎? – guival