I have the following tasks:
get_filters()
get_customers(filter_a, filter_b)
get_orders(filter_a, filter_b)
get_returns(filter_a, filter_b)
The serial code works as follows:
def extract_customer():
filt_a, filt_b = get_filters()
cust = get_customers(filt_a, filt_b)
ord = get_orders(filt_a, filt_b)
ret = get_returns(filt_a, filt_b)
merged = cust.join([ord, ret])
I would like to distribute the celery task so that get_filters is executed first, and then get_customers, get_orders and get_returns are executed at the same time. and finally, when they are done, the merge function returns the combined dataset.
I'm not sure how to do this using canvas in celery.
Thank you for your help.
source
share