Closed josejachuf closed 4 years ago
@josejachuf I'm not sure what you trying to test here. Both your tests uses synchronous code, doesn't really matter if the route is a function or a coroutine function. The code inside it is the same, so you will get same results.
Hi @gi0baro Ready, now I understood.
I changed
time.sleep(5)
to
await asyncio.sleep(5)
And I got what I expected:
chrome 08:43:16 firefox 08:43:17 brave 08:43:18 INFO: 127.0.0.1:33662 - "GET /slow/chrome HTTP/1.1" 200 OK INFO: 127.0.0.1:33666 - "GET /slow/firefox HTTP/1.1" 200 OK INFO: 127.0.0.1:33668 - "GET /slow/brave HTTP/1.1" 200 OK
Thanks
I am trying to see the differences in behavior using the asynchronous mode of the functions, but I don't succeed
given the following function:
refreshing the three pages, open in three different browsers I get:
tried many times and always the same results, 5 seconds always pass All this using the development server, maybe this can be seen in production.
I expected something like that in async mode:
Is my test function not correct?