Can SQLAlchemy be configured to be non-blocking?

后端 未结 3 1216
南笙
南笙 2020-12-08 00:29

I\'m under the impression that database calls through SQLAlchemy will block and aren\'t suitable for use in anything other than synchronous code. Am I correct (I hope I\'m n

3条回答
  •  爱一瞬间的悲伤
    2020-12-08 01:25

    Have a look at Tornado as they've got some neat non-blocking libraries, particularly tornado.gen.

    We use that along with Momoko, a non-blocking psycopg wrapper lib for Tornado. It's been great so far. Perhaps the only drawback is you lose all the model object stuff that SQLAlchemy gives you. Performance is unreal though.

提交回复
热议问题