Performance: Celery installation and setup
MEDIUM IMPACT
This affects backend task processing speed and responsiveness of the Django app by offloading work from the main request cycle.
from celery import shared_task @shared_task def send_mass_email(): # Long running task pass # In view send_mass_email.delay() return HttpResponse('Email sending started')
def send_email(request): # Long running task send_mass_email() return HttpResponse('Email sent')
| Pattern | Backend Blocking | User Response Delay | Resource Usage | Verdict |
|---|---|---|---|---|
| Synchronous task in view | Blocks main thread | High delay | High CPU during request | [X] Bad |
| Asynchronous Celery task | No blocking | Minimal delay | Offloaded to worker | [OK] Good |