0
I’m trying to understand a slowdown in a small async Python service. One handler makes a request to another API, and while that call is waiting, unrelated requests seem to take longer too.
import requests
async def get_profile(user_id):
# This synchronous call waits for the remote server and blocks the event loop.
response = requests.get(f"https://example.com/users/{user_id}")
# Parse the response after the blocking network call finishes.
return response.json()
I thought marking the function async would let the server handle other work during the wait. Is the blocking network call the reason that isn’t happening, or am I missing something about how async handlers are scheduled?