Bird
0
0

Why is it important to avoid calling blocking functions directly in Flask routes when using asynchronous tasks?

hard📝 Conceptual Q10 of 15
Flask - Background Tasks
Why is it important to avoid calling blocking functions directly in Flask routes when using asynchronous tasks?
ABlocking functions improve security by slowing down requests.
BBlocking functions automatically run in background threads.
CBlocking functions delay the response and reduce app scalability.
DBlocking functions are required for async tasks to work.
Step-by-Step Solution
Solution:
  1. Step 1: Understand blocking function impact

    Blocking functions pause the Flask request until they finish, delaying response.
  2. Step 2: Recognize effect on scalability

    Delays reduce how many users the app can serve at once, hurting scalability.
  3. Final Answer:

    Blocking functions delay the response and reduce app scalability. -> Option C
  4. Quick Check:

    Blocking = slower response, less scalable [OK]
Quick Trick: Avoid blocking calls in routes to keep app responsive [OK]
Common Mistakes:
MISTAKES
  • Thinking blocking improves security
  • Assuming blocking runs in background automatically
  • Believing blocking is needed for async

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes