by bcoates · 14y ago · 0 comments
There's an awful global lock on the actual execution of python code, but unless the problem is performance or contention worrying about it is premature.
"As a Django developer, there wasn’t a straightforward and obvious way to just do things in the background on a page request"
I started thinking, "um, django produces http responses, you can only respond once...".
Clearly, from his gevents example, he's looking to do things that take time, and wants to do them as concurrently as possible, then send the whole response at once. But if he really doesn't want the user to wait, then this is not something you should be doing in a webserver anyways. You really should be building that into the front end javascript, and let it handle all the async data grabs from small, fast, cacheable web requests, then redraw the page as the data comes in.
This could be a lot more accessible to beginners, however, because there are moving pieces like a message queue that have to be set up and blah blah.