Python Forum
Wsgiref with asyncio ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wsgiref with asyncio ?
#9
(Oct-31-2022, 03:47 PM)wavic Wrote: You can print a message for every request and after that you await asyncio.sleep(15) both in maincoro. Run the whole thing and refresh the "web page" two-three times. If you get the message on every refresh it is asynchronous.

Consider looking at ASGI. You will end up building one or similar anyway. Just to build on top of your framework. Unless you want to do something completely different. Smile

Do not use time.sleep. It is blocking. Async.sleep is not

I believe that, to find out if the function really works asynchronously, it captures the id of the secondary thread, but how do I do that, as it seems to be dynamic?
Reply


Messages In This Thread
Wsgiref with asyncio ? - by JohnnyCoffee - Oct-27-2022, 06:59 PM
RE: Wsgiref with asyncio ? - by wavic - Oct-28-2022, 11:17 AM
RE: Wsgiref with asyncio ? - by JohnnyCoffee - Oct-28-2022, 02:12 PM
RE: Wsgiref with asyncio ? - by wavic - Oct-28-2022, 02:59 PM
RE: Wsgiref with asyncio ? - by JohnnyCoffee - Oct-30-2022, 10:36 PM
RE: Wsgiref with asyncio ? - by wavic - Oct-31-2022, 02:50 AM
RE: Wsgiref with asyncio ? - by JohnnyCoffee - Oct-31-2022, 03:42 PM
RE: Wsgiref with asyncio ? - by wavic - Oct-31-2022, 03:47 PM
RE: Wsgiref with asyncio ? - by JohnnyCoffee - Nov-01-2022, 08:35 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020