WBAR
WBAR

Reputation: 4984

Celery 3.1 - Executing chain of tasks asynchronicaly

Based on "Best Practices" in section "Avoid launching synchronous subtasks" I would like to execute chain in background, not waiting for an job's chain result. How to achieve that ?

Is it that simple as (based on example in link I've provided)?:

def update_page_info(url):
    # fetch_page -> parse_page -> store_page
    chain = fetch_page.s() | parse_page.s() | store_page_info.s(url)
    chain.delay()

Upvotes: 1

Views: 382

Answers (1)

daniula
daniula

Reputation: 7028

Instead of

chain.delay()

there should be

chain.apply_async()

The rest looks good.

Upvotes: 1

Related Questions