truease.com
truease.com

Reputation: 1301

How to use mysql in gevent based programs in python?

I have found that ultramysql meets my requirement. But it has no document, and no windows binary package.

I have a program heavy on internet downloads and mysql inserts. So I use gevent to solve the multi-download-tasks problem. After I downloaded the web pages, and parsed the web pages, I get to insert the data into mysql.

Is monkey.patch_all() make mysql operations async?

Can anyone show me a correct way to go.

Upvotes: 4

Views: 1354

Answers (2)

truease.com
truease.com

Reputation: 1301

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

Upvotes: 1

scape
scape

Reputation: 707

Postgres may be better suited due to its asynchronous capabilities

Upvotes: 1

Related Questions