Bird
0
0

Why is it important to configure a message broker like RabbitMQ or Redis when calling tasks asynchronously in Django with Celery?

hard📝 Conceptual Q10 of 15
Django - Celery and Background Tasks
Why is it important to configure a message broker like RabbitMQ or Redis when calling tasks asynchronously in Django with Celery?
ABecause the broker compiles the Django code for faster execution
BBecause the broker runs the Django development server
CBecause the broker stores the Django database models
DBecause the broker queues and delivers tasks to workers for asynchronous execution
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of message brokers

    Message brokers like RabbitMQ or Redis queue tasks and send them to Celery workers to run asynchronously.
  2. Step 2: Eliminate unrelated functions

    Brokers do not compile code, store database models, or run the Django server.
  3. Final Answer:

    Because the broker queues and delivers tasks to workers for asynchronous execution -> Option D
  4. Quick Check:

    Broker queues tasks for async workers [OK]
Quick Trick: Broker queues tasks to workers for async processing [OK]
Common Mistakes:
MISTAKES
  • Thinking broker compiles code
  • Confusing broker with database
  • Assuming broker runs Django server

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes