gevent和龙卷风之间的区别 [英] Differences between gevent and tornado

查看:141
本文介绍了gevent和龙卷风之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道tornadogevent都是异步python框架.

I understand that both tornado and gevent are asynchronous python frameworks.

在阅读瓶文档时,我发现gevent实际上不是异步的,您可以创建数千个同步工作的伪线程.

While reading the bottle documentation I found that gevent actually is NOT asynchronous, and you can create thousands to pseudo-threads that work synchronously.

第二,在gevent中,您不能及早终止请求处理程序,而需要返回完整的响应,而在龙卷风中则可以. (如果我错了,请纠正我)

Seondly, in gevent, you can not terminate the request handler early and you need to return the full response, while in tornado you can. (correct me if I'm wrong here)

有人可以详细描述这些系统在内部如何工作以及它们有何不同之处.另外,WSGI如何发挥这些系统的异步特性?这些框架是否符合WSGI,如果是的话,如何?

Can some one describe in detail how these systems work internally, and in what ways they are different. Also, how does WSGI play with the asynchronous nature of these systems? Do these frameworks conform to WSGI, if yes, how?

推荐答案

已阅读:

http://en.wikipedia.org/wiki/协程

和:

http://en.wikipedia.org/wiki/Event-driven_architecture

http://en.wikipedia.org/wiki/Event-driven_programming

gevent包使用协程,而Tornado是事件驱动的.

The gevent package uses coroutines and Tornado is event driven.

即使是驱动系统也不容易映射到WSGI,但是如果可以修补阻塞点以在事物阻塞时切换协程,则可以使协程系统(因为它看起来像线程)可以支持WSGI.

Even driven systems don't readily map to WSGI, but a coroutine system, because it looks like threads, can be made to support WSGI if blocking points can be patched to switch coroutines when things would block.

这篇关于gevent和龙卷风之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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