有人知道Tornado Web框架的异步CouchBase客户端吗? [英] Does anyone know of an asynchronous CouchBase client for the Tornado web framework?

查看:55
本文介绍了有人知道Tornado Web框架的异步CouchBase客户端吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Web应用程序,该应用程序使用nginx来提供静态内容,并使用龙卷风来提供动态内容.我当时想将CouchBase用作我的数据存储,但是在查找适合与Tornado框架(即异步)一起使用的客户端时遇到了麻烦.有人知道吗?

I am writing a web application that uses nginx to serve static content and tornado to serve dynamic content. I was thinking of utilizing CouchBase as my datastore, but am having trouble locating a suitable client for use with the Tornado framework (i.e. asynchronous). Anybody know of one?

我看过trombi: https://github.com/inoi/trombi 但不能找不到很多有关它的信息.如果有人对它有任何经验(好坏),我很想听听.

I've seen trombi: https://github.com/inoi/trombi but couldn't find much information on it. If anyone has had any experience with it (good or bad), I'd love to hear about it.

推荐答案

我真的建议您坚持使用Couchbase发布的Python代码.尽管从技术上讲不是异步的,但是查询是如此之快,以至于它实际上并没有考虑到事物.它不像为数据库查询建立一个可以轻松锁定一段时间的连续操作的查询.更不用说事实是,在很多情况下,尝试为它找到一些第三方模块会丢失很多负载平衡和存储桶管理代码.

I would really recommend sticking with the Couchbase released code for Python. While it isn't technically asynchronous, the queries are so fast that it really doesn't factor into things. Its not like building out a query for a Database which could easily lock up continued actions for a period of time. Not to mention the fact there is a lot of load balancing and bucket management code that you would lose in most situations by trying to find some third party module for it.

此外,您始终可以构建一个多处理程序包来创建子流程,以处理从主流程流中删除这些调用的过程,并将影响减小到几乎没有.

Also you can always build a multiprocessing package to create sub-processes to handle removing these calls from the primary process stream and reduce the impact to almost nothing.

更新

另一个选择是使用Tornado的内部回调功能来抵消阻止过程,以免损害浏览.此处描述了一种方法: http://tornadogists.org/2185380/

Another option is to use Tornado's internal callback functionality to offset the blocking process so it doesn't impair browsing. A method for this is described here: http://tornadogists.org/2185380/

这篇关于有人知道Tornado Web框架的异步CouchBase客户端吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆