How to use mysql in gevent based programs in python?

I found that ultramysql meets my requirements. But it has no document and no Windows binary package.

I have a program uploaded to internet download and mysql inserts. Therefore, I use gevent to solve the problem with multiple downloads. After I loaded the web pages and parsed the web pages, I need to paste the data into mysql.

Is monkey.patch_all () executing mysql async operations?

Can someone show me the right way.

+4
source share
2 answers

Postgres may be better due to its asynchronous capabilities

+1
source

I think one solution is to use pymysql. Since pymysql uses the python socket, after the patch, the monkey should work with gevent.

+1
source

Source: https://habr.com/ru/post/1412335/


All Articles