Bird
0
0

Which of the following is the correct way to call a Celery task asynchronously in Django?

easy📝 Syntax Q12 of 15
Django - Celery and Background Tasks
Which of the following is the correct way to call a Celery task asynchronously in Django?
Amy_task.run()
Bmy_task.execute()
Cmy_task.delay()
Dmy_task.start()
Step-by-Step Solution
Solution:
  1. Step 1: Recall how to call Celery tasks asynchronously

    Celery tasks are called asynchronously using the delay() method on the task function.
  2. Step 2: Identify the correct method

    Only delay() triggers the task asynchronously; other methods like run() execute synchronously or do not exist.
  3. Final Answer:

    my_task.delay() -> Option C
  4. Quick Check:

    Async call method = delay() [OK]
Quick Trick: Use delay() to run tasks asynchronously [OK]
Common Mistakes:
MISTAKES
  • Calling run() which runs task synchronously
  • Using execute() which is not a Celery method
  • Trying start() which does not exist for tasks

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes