gevent mysql
Posted Go_Forward
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gevent mysql相关的知识,希望对你有一定的参考价值。
使用gevent实现mysql并发时,每个greenlet应该独享一个mysql连接,否则,不同的greenlet之间会相互影响。
ultramysql doesn‘t allow you to make multiple queries on the same mysql connection, it just makes it async friendly. So you will either need a new mysql connection for each greenlet or use locking primitives to makes sure only one greenlet is using the connection at a time.
https://stackoverflow.com/questions/13308446/how-to-insert-async-into-mysql-using-python
以上是关于gevent mysql的主要内容,如果未能解决你的问题,请参考以下文章