celery use in the project

1 celery is a framework for handling asynchronous time-consuming task for the worker portion 3 and store and broker composition

worker is a worker to process messages

broker request message is stored in the repository

store warehouse is used to store the results

2 celery use

First of all have a main file

Also have a config file

Then is the task executable file

Figure celery directory

 

 

main.py file

 

 

config.py file

 

 tasks.py file

 

 At last

celery services open command

celery -A celery_tasks.email.tasks worker -l info 

Note: celery_tasks.email.tasks is the path of the function performed correctly filled celery service to start

Guess you like

Origin www.cnblogs.com/tangda/p/12041630.html