Download as PDF, PPTX







![SomeCode…Yay!
from celery import Celery
def make_celery(app):
celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
TaskBase = celery.Task
class ContextTask(TaskBase):
abstract = True
def __call__(self, *args, **kwargs):
with app.app_context():
return TaskBase.__call__(self, *args, **kwargs)
celery.Task = ContextTask
return celery](https://image.slidesharecdn.com/celery-160113100035/75/Introduction-to-Celery-8-2048.jpg)






Celery is an asynchronous task queue that allows tasks to be handled outside of HTTP requests. For example, a web application could use Celery to poll an API every 10 minutes and store the results in a database without blocking the HTTP response. Celery distributes tasks by passing messages, allowing tasks to run across multiple worker processes. It uses brokers like Redis to manage queues and tasks. Developers define tasks as functions that are executed asynchronously by Celery workers.