Jacky

教土豆学计算机

Celery is a distributed task system.

Task

A task is a class that can be created out of any callable. It performs dual roles in that it defines both what happens when a task is called (sends a message), and what happens when a worker receives that message.

Every task must have a unique name, and a new name will be generated out of the function name if a custom name is not provided.

Retry

app.Task.retry() can be used to re-execute the task. When you call retry it’ll send a new message, using the same task-id, and it’ll take care to make sure the message is delivered to the same queue as the originating task.

Worker

…

Time Limits

…

Rate Limits

Token Bucket…

Auto scaling

…

Event

The worker has the ability to send a message whenever some event happens. These events are then captured by tools like Flower, and celery events to monitor the cluster.

Heartbeat

…

Configuration

…

Best Practices

Optimizing

FAQ

Further Reading