美文网首页
sqlalchemy 是非异步库

sqlalchemy 是非异步库

作者: 来一碗花甲粉 | 来源:发表于2019-06-03 14:42 被阅读0次

    The "scope" in scoped_session is a thread, which makes it inappropriate for use in an asynchronous framework like Tornado. It's been a long time since I've used sqlalchemy sessions, but I think what you want to do is put a sessionmaker on the Application, and make a session from it in RequestHandler.prepare (not initialize - they're almost equivalent, but if something goes wrong you generally get nicer error pages from prepare).

    相关文章

      网友评论

          本文标题:sqlalchemy 是非异步库

          本文链接:https://www.haomeiwen.com/subject/gkwioqtx.html