0% found this document useful (0 votes)
208 views12 pages

Introduction To Celery

Celery is an asynchronous task queue that allows users to offload long-running or blocking tasks from the main application thread to increase speed and scalability. It works by placing tasks in a message queue like RabbitMQ for Celery worker processes to retrieve, process, and store results asynchronously without blocking the main application. Common use cases include image processing, sending bulk emails, interacting with external APIs, and running periodic tasks instead of using cron jobs.

Uploaded by

phillip_jain
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
208 views12 pages

Introduction To Celery

Celery is an asynchronous task queue that allows users to offload long-running or blocking tasks from the main application thread to increase speed and scalability. It works by placing tasks in a message queue like RabbitMQ for Celery worker processes to retrieve, process, and store results asynchronously without blocking the main application. Common use cases include image processing, sending bulk emails, interacting with external APIs, and running periodic tasks instead of using cron jobs.

Uploaded by

phillip_jain
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

An Introduction to Celery

WHAT IS CELERY?
Celery is an asynchronous task queue/job queue

WORKING WITH CELERY MEANS :


NON BLOCKING SCALE SPEED

USE CASES
IMAGE PROCESSING SENDING 1K EMAILS INTERACTIONS WITH EXTERNAL API PERIODIC TASKS (instead of cron)

HOW DOES IT WORK?

USER
REQUEST

APPLICATION
TASKS

MESSAGE QUEUE CELERY WORKERS


STORE RESULTS

WHAT DO I NEED?

Django (django-celery) Pylons (celery-pylons) Flask (Flask-Celery) Python

CELERY

MESSAGE QUEUE
RABBITMQ REDIS BEANSTALK MONGODB COUCHDB

CELERY (pip install celery) RABBITMQ (http://www.rabbitmq.com/download.html)


EXAMPLE
from celery.task import task @task def add(x, y): return x + y

celeryproject.org IRC #celery mailing list celery-users

WHAT'S NEXT?

@gchandrasa github.com/gchandrasa

THANK YOU

You might also like