Google App Engine中可以进行长时间投票吗? [英] Is long polling possible in Google App Engine?

查看:90
本文介绍了Google App Engine中可以进行长时间投票吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要制作需要频繁轮询服务器的应用程序,但GAE对请求有限制,因此提出大量请求可能会非常昂贵。是否有可能使用长轮询和请求等待最大30秒进行更改?

解决方案

Google AppEngine有一项新功能Channel API,并且您有
a 构建一个很好的实时应用程序的可能性。另一个解决方案是使用第三方彗星服务器,如mochiweb
或者使用iframe模式扭曲。

Client1,等待事件:

  client1 --Iframe Pattern  - > Erlang / Mochiweb(HttpLongPolling):

Client2,发送消息:

  client2 --XhrIo  - > AppEngine --UrlFetch  - > Erlang / Mochiweb 

使用mochiweb和comet模式,Richard Jones写了一个好的
主题(谷歌:理查德琼斯百万用户彗星应用程序)。


I need to make application that needs to poll server often, but GAE has limitations on requests, so making a lot of requests could be very costly. Is it possible to use long polling and make requests wait for the maxium 30 seconds for changes?

解决方案

Google AppEngine has a new feature Channel API, with that you have a possibility to build a good realtime application.

Another solution is to use a third part comet server like mochiweb or twisted with a iframe pattern.

Client1, waiting a event:

client1 --Iframe Pattern--> Erlang/Mochiweb(HttpLongPolling):

Client2, sending a message:

client2 --XhrIo--> AppEngine --UrlFetch--> Erlang/Mochiweb

To use mochiweb with comet pattern, Richard Jones has written a good topic (on google: Richard Jones A Million-user Comet Application).

这篇关于Google App Engine中可以进行长时间投票吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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