The celery documentation tells me that if multiple tasks are chained together, the result of the first task will be the first argument of the next. My problem is, I can't get it to work when I have a task that returns multiple results.
Example:
@task()
def get_comments(url):
#get the comments and the submission and return them as 2 objects
return comments, submission
@task
def render_template(threadComments, submission):
#render the objects into a html file
#does not return anything
Now, if I call them in a chain like (get_comments(url) | render_template()).apply_asnc() python will throw an TypeError: render_template() takes exactly 2 arguments (0 given)
.
I can see that the results are not unwrapped and applied to the arguments. If I only call get_comments, I can do:
result = get_comments(url)
arg1, arg2 = result
and get both results.