bulDDoS
bulDDoS

Reputation: 53

Difference between send_task() and apply_async()

I'm not sure about the difference between apply_async() and send_task() in Celery library in Python, specially when using Tasks pools. What I'm mainly looking for is having a centralized server with all tasks defined in there, and using some Redis queues, the other physical instances are able to publish/send events to the different queues targetting different tasks using Pools, without the need to define all the list of the tasks in each publisher script to be able to use.

I've looked into the documentation and didn't find much to answer my question actually.

Thanks in advance!

Upvotes: 5

Views: 4058

Answers (1)

DejanLekic
DejanLekic

Reputation: 19787

They both do the same thing (request particular task to be executed). However for apply_async() to work you need the definition of the task. send_task() is extremely convenient in the case you really do not want to distribute the code just so that you can trigger particular task (sure, you must use the same serialization, and know name of the task, but if you are codebase owner this is not an issue).

Upvotes: 9

Related Questions