I’m new to python and may be being dumb here, but I can’t figure out why my server cant handle more than one connection once.
My sample code:
import time
from aiohttp import web
def testF(request): #I've tried with async def testF also
print('Called')
time.sleep(10)
print('Answered')
return web.Response(
content_type="application/json",
text='',
)
if __name__ == "__main__":
app_aio = web.Application()
app_aio.router.add_post("/test", testF)
web.run_app(app_aio, host="0.0.0.0", port=5200)
If I run this webserver and call the url multiple times at once it will only start the second run after the first one is returned, why?
Current output:
Called
Answered
Called
Answered
Called
Answered
Called
Answered
Expected output:
Called
Called
Called
Called
Answered
Answered
Answered
Answered