How do I chunk tasks with keyword arguments? For example, this task:
@app.task
def add(x, y, multiply=1, unit="GB"):
return '%s %s' % ((x + y) * multiply, unit)
I can call this task as usual with add.apply_async(args=(1, 2), kwargs={'unit': 'MB'})
but how do I chunk it?
I want to do something like :
add.chunks([{'args': (1, 2), 'kwargs': {'unit': 'MB'}}, {'args': (3, 4), 'kwargs': {'unit': 'KB'}}, ...], 10)
The documentation only shows how to use chunks with positional arguments:
from proj.tasks import add
res = add.chunks(zip(range(100), range(100)), 10)()