SQLAlchemy and Twisted

女生的网名这么多〃 提交于 2019-11-30 18:14:22

问题


I'v learned twisted for somewhile and would like to do some network communication and local db operation as well.BTW, MySQL DB adopted, non-blocking required and perferred.

Someone told me that sqlalchemy is just great. But as far as I have known from the Internet, the two may not work together perfectly(http://twistedmatrix.com/pipermail/twisted-python/2009-March/019359.html ).

So I would like to know if anyone has this kind of experience(either successful or a failure is welcomed) to make both of them work together?

And Could anyone tell why there is no way for them to work together?

Thank you in advance!


回答1:


SQLAlchemy presents a blocking interface to database access. You can use it with Twisted if you use it in a separate thread. It's frequent to use many threads with SQLAlchemy anyway, so there's nothing really special going when you try to use it with Twisted. It only seems strange because Twisted itself mostly offers APIs which you don't need threads for.



来源:https://stackoverflow.com/questions/6990698/sqlalchemy-and-twisted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!