I am trying to retrieve a Task object from my tasks so that I can wait for multiple tasks at the same time. My current code setup is something like this:
@db_task(queue='new_queue')
def function_wrapper():
print('task is running')
return True # must return something for blocking to work
@db_task(queue='new_queue')
def sync():
product_tasks = [
function_wrapper(),
function_wrapper(),
function_wrapper(),
function_wrapper(),
]
results = [task_result.get(blocking=True) for task_result in product_tasks]
However, it seems that the function_wrapper() returns None instead of a task object. The print function is shown correctly in the outputs when running the queue.
I am trying to retrieve a Task object from my tasks so that I can wait for multiple tasks at the same time. My current code setup is something like this:
However, it seems that the
function_wrapper()
returns None instead of a task object. The print function is shown correctly in the outputs when running the queue.