如何通过名称获取任务?从任务队列中按名称获取任务
from google.appengine.api import taskqueue
taskqueue.add(name='foobar', url='/some-handler', params={'foo': 'bar'}
task_queue = taskqueue.Queue('default')
task_queue.delete_tasks_by_name('foobar') # would work
# looking for a method like this:
foobar_task = task_queue.get_task_by_name('foobar')
应该可以使用REST API(https://developers.google.com/appengine/docs/python/taskqueue/rest/tasks/get)。但我宁愿像task_queue.get_task_by_name('foobar')
。有任何想法吗?我错过了什么?
好点。怎么样一个简单的''task_queue.task_exists('foobar')''? – mattes
同样的故事。当你有“它确实存在”的时候,它可能不再存在了。就像薛丁格的猫。 –
嗯。我不明白在询问任务时是否存在什么问题? – mattes