Joke Collection Website - Blessing messages - What business problem does python solve with celery?

What business problem does python solve with celery?

Celery is a distributed task queue that focuses on real-time processing and task scheduling. The so-called task is a message, and the payload in the message contains all the data needed to perform the task.

Common scenarios for using celery are as follows:

1.Web application. When the operation triggered by the user takes a long time to complete, it can be handed over to celery for asynchronous execution as a task, and then returned to the user after execution. During this time, users don't need to wait, which improves the overall throughput and response time of the website.

2. Plan the task. The production environment often runs some scheduled tasks. If you have thousands of servers and thousands of tasks, it is difficult to manage the scheduled tasks. Celery can help us quickly set up different tasks on different machines.

3. Any extra work done synchronously can be done asynchronously. Such as sending SMS/E-mail, pushing messages, cleaning/setting cache, etc.

Celery also has the following characteristics:

1. It is convenient to view the execution of scheduled tasks, such as whether the execution was successful, the current status, the time taken to execute the tasks, etc.

2. You can add, update and delete tasks using the full-featured management background or the command line.

3. It is convenient to associate tasks with configuration management.

4. Multi-process, Eventlet and Gevent modes can be selected for concurrent execution.

5. Provide an error handling mechanism.

-Provide a variety of task primitives to facilitate task grouping, splitting and calling chain.

-Support multiple message brokers and storage backend.