3 ms·
While these kind of articles are useful for learners, I hope someone please explain concurrency models for uWSGI/Gunicorn/uvicorn/gevent. Like how long does glo
by est 2y ago
While these kind of articles are useful for learners, I hope someone please explain concurrency models for uWSGI/Gunicorn/uvicorn/gevent. Like how long does global variables live? How does context switching (like the magic request from Flask) work? How to spawn async background tasks? Is it safe to mix task schedulers inside web code? How to measure when concurrency is full and how to scale? What data can be shared between executors and how? How to detect back-pressure? How to interrupt long-running function when client disconnects (nginx 499)? How to proper handle unix signals for threads/multiprocess/asyncio?
I reality no one writes from scratch with threads, processes or asyncio unless you are a library author.
- bmitc 2y ago> I reality no one writes from scratch with threads, processes or asyncio unless you are a library author. Is that really true in the case of asyncio? From my experience, it isn't. I am not familiar with the other three libraries you mentioned, but gevent predates asyncio and is separate from it. It does not build on top of asyncio, and is outdated because of that. It doesn't even have support for WebSockets.