这个函数应在服务中复用异步 I/O。找出两个客户端边界错误。
Python
import httpx
async def load_order(order_id: int) -> dict:
async with httpx.AsyncClient() as client:
response = client.get(
f"https://inventory.test/orders/{order_id}"
)
return response.json()