Recall & Review
beginner
What is Celery in the context of Flask applications?
Celery is a tool that helps Flask apps run tasks in the background, so the app stays fast and responsive while doing heavy work separately.
Click to reveal answer
intermediate
How does Celery communicate with Flask to run tasks asynchronously?
Celery uses a message broker like Redis or RabbitMQ to send and receive task messages between Flask and worker processes that run tasks in the background.
Click to reveal answer
beginner
What is a 'worker' in Celery?
A worker is a separate process that listens for tasks from the message broker and runs them independently from the Flask app.
Click to reveal answer
beginner
Why should you not run long tasks directly in Flask routes?
Running long tasks in Flask routes blocks the app, making users wait and slowing down responses. Celery moves these tasks to the background to keep the app fast.
Click to reveal answer
intermediate
What are the main components needed to integrate Celery with Flask?
You need the Flask app, a Celery instance configured with the Flask app context, a message broker (like Redis), and worker processes to run tasks.
Click to reveal answer
What role does Redis play in Celery integration with Flask?
✗ Incorrect
Redis is commonly used as a message broker to queue tasks that Celery workers pick up and execute.
Which component runs the background tasks in Celery?
✗ Incorrect
Worker processes listen to the message broker and execute the background tasks.
Why use Celery with Flask for long-running tasks?
✗ Incorrect
Celery allows tasks to run asynchronously so the Flask app can respond quickly without waiting.
What must you configure to connect Celery with Flask?
✗ Incorrect
Celery needs to be configured with the Flask app context to access app settings and resources.
Which of these is NOT a Celery component?
✗ Incorrect
Celery does not have a 'Router' component; it uses brokers, workers, and optionally schedulers.
Explain how Celery helps improve Flask app performance.
Think about what happens when a task takes a long time and how Celery handles it.
You got /4 concepts.
Describe the main steps to integrate Celery with a Flask application.
Consider what you need to connect and run for background tasks.
You got /4 concepts.