Running an asynchronous mode Python function with Celery

Asked

Viewed 80 times

0

I have the function test() that takes a long time and I want to execute it asynchronously. I put the decorator of the Celery in the same as below:

from celery import task

@task
def test():
    (...)
    return 'done1

And I execute her doing:

test.delay()

When I run my program it is not put in the background as expected, it performs normally synchronously. I’m forgetting something related to Celery?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.