Question 4 of 5

What does async speed up when the application waits for a model?

The helper sends two questions to a remote service. The developer then runs a heavy local calculation and expects the same speedup from async.

If two services each take a second to reply, calling them one at a time means waiting about two seconds. While the first service prepares its reply, Python can send the second request. If that second is spent adding numbers in an ordinary Python loop, there is no network wait to put to use.

WHERE TO START

While one request waits for a response, what else could Python do?

What to know before this question
Topic example · Response status

Change 200 to 404. What will the program print?

status = 200
print(status == 200)
Line notes
  1. Store a service response code.
  2. Compare the code with 200 and print the result.

How would you rate your understanding?

This is your self-assessment. Progress is saved in this browser.

Not rated yet

← Back to Python and APIs