Bird
0
0

How can you combine Flask with Celery to monitor the status of asynchronous tasks effectively?

hard📝 Application Q9 of 15
Flask - Background Tasks
How can you combine Flask with Celery to monitor the status of asynchronous tasks effectively?
ARun Celery tasks inside Flask routes synchronously
BUse Celery task IDs and Flask routes to query task states
CStore task results only in Flask session variables
DUse Flask-Mail to notify task completion
Step-by-Step Solution
Solution:
  1. Step 1: Understand Celery and Flask integration

    Celery runs tasks asynchronously and provides task IDs to track status.
  2. Step 2: Use Flask routes to query Celery task states

    Flask routes can accept task IDs and query Celery backend for current task state.
  3. Final Answer:

    Use Celery task IDs and Flask routes to query task states -> Option B
  4. Quick Check:

    Celery task IDs + Flask routes = effective monitoring [OK]
Quick Trick: Query Celery task states via Flask routes using task IDs [OK]
Common Mistakes:
MISTAKES
  • Running Celery tasks synchronously defeats purpose
  • Storing results in session is unreliable
  • Using email for status instead of querying

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes