Where is the asynchronism of Sanic?

has the following code. In my expectation, using two browser windows (A _ Magi B window) to access http://127.0.0.1:8000 at the same time, the total time to wait for the two pages to load should be close to 10 seconds, but it actually takes 20 seconds, A window loads in 10 seconds, B window loads in 10 seconds.

import asyncio
from sanic import Sanic, response

app = Sanic(__name__)


@app.route("/")
async def test(request):
    await asyncio.sleep(10)  -sharp  10 
    return response.json({"test": True})


if __name__ == "__main__":
    app.run(port=8000, debug=True)
Aug.16,2021
The

code is fine, and opening two identical links with Chrome will cause the other one to be loaded after it has been loaded. So use tools such as ab when testing.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31c82-2b30b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31c82-2b30b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?