4 ms·
I was under the impression that gevent was like a new version of eventlet. Other than the docs (which isn't insignificant), why choose one over the other?
by bigethan 15y ago
I was under the impression that gevent was like a new version of eventlet. Other than the docs (which isn't insignificant), why choose one over the other?
- pjscott 15y agoThey're pretty similar. The main difference is that Eventlet supports more event loops, has a messier basic architecture, is slightly slower, and lets you defer blocking tasks to threads. Since I'm connecting to MySQL, which happens through blocking C code in libmysql, that's pretty important to me. Eventlet's db_pool module is very nice. Personally, I'm happy with eventlet and can't see why I would want to go to gevent. Does anybody using gevent want to chime in on what's better about it?
- Continuation 15y agogevent has utilities to turn Python blocking calls into non-blocking ones. In your case you could switch to a pure Python MySQL driver and gevent will turn all your mySQL calls into async. Actually there're also gevent non-blocking MySQL drivers that are written in C.