在 GWT 中调用什么来使 2 UI 保持一致? [英] What does it call in GWT to make 2 UI consistent?

查看:14
本文介绍了在 GWT 中调用什么来使 2 UI 保持一致?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了一段 Google I/O 的视频,发现了一个 GWT UI 在客户端之间非常一致的例子.您可以在客户端之间几乎实时地保存、添加、拖放.我目前不明白这个的基本原理(在 GWT 中,我认为它实现了 Comet),所以有人可以给我一个术语或定义吗?以便我可以在 Google 上获取更多信息?

I saw a video of Google I/O and found an example of GWT UI being very consistent between clients. Which you can save, add, drag and drop in almost real time between clients. I currently don't understand the basic of this (In GWT, i think it implement Comet), so is there anyone can give me a term or definition for this? so I can get it on Google for more information?

非常感谢

推荐答案

好的,我认为您正在寻找的名称以 Comet、服务器推送、反向 Ajax(仅举几例 - 它们的意思都一样,在研究这个主题时可能会有所帮助).简而言之,它描述了 服务器 启动与 客户端 的连接时的模型/情况(通常情况相反).当然,由于这是客户端,它实际上并不是在侦听连接,而是使用了一些技巧来使它看起来像长轮询(尝试尽可能长时间地保持与服务器的连接打开,等待服务器有新数据发送给客户端.在最大连接时间后,客户端立即重新连接,依此类推).这是一个非常酷的功能,如果使用得当,可以真正改善用户体验.

OK, I think what you are looking for is known under the names Comet, Server Push, Reverse Ajax (to name a few - they all mean the same, might be helpful when doing research on this subject). In short, it describes a model/situation when the server initiates the connection to the client (normally, it's the other way round). Of course, since this is the client side, it's not actually listening for connections, it's using some tricks to make it appear so - like long polling (trying to keep the connection with the server open for as long as possible, waiting for the server to have new data to send to the client. After the maximum connection time, the client immediately reconnects and so it goes). It's a very cool feature, one that when used properly can really improve user experience.

至于这个概念的实现:

  • rocket-gwt 具有 远程模块用于它
  • cometd 是一位广受欢迎的资深选手;)
  • Ajax 推送引擎 是一个相对较新的附加功能 - 他们打造了自己的服务器(用C),它可能比其他解决方案提供更好的性能,也可能不提供更好的性能,缺点是服务器端可能更难实现(用 C 编写模块或通过 SpiderMonkey 服务器端 JavaScript).注意:APE 服务器只能在 Linux、BSD 或 Mac OS X 上运行.
  • NGiNX_HTTP_Push_Module - 我最喜欢的,因为他们的协议最简单/最干净,他们使用 nginx 这意味着没有运行额外的服务器(并且不需要 Java 服务器 - 对于像我这样不在服务器端使用 Java 的人很有用).该协议非常简单,纯 GWT 实现应该很容易编写(事实上,这就是我正在做的).
  • rocket-gwt has the Remoting module for it
  • cometd is a popular and a veteran competitor ;)
  • Ajax Push Engine is a relatively new addition - they fashion their own server (nicely written in C), which may or may not offer better performance than other solutions, the downside is that the server side might be harder to implement (either write modules in C or server side JavaScript through SpiderMonkey). Note: the APE server can only be run on Linux, BSD or Mac OS X.
  • NGiNX_HTTP_Push_Module - my favorite, because their protocol is the easiest/cleanest, they use nginx which means no extra server running (and no Java server needed - useful for people like me who don't use Java on the server side). The protocol is so easy that a pure GWT implementation should be easy to write (in fact, that's what I'm doing).

根据您的服务器端,您有很多选择——cometd 是一个可靠的解决方案,但他们使用的 Bayeux 协议有点像噩梦,TBH.几个月前我尝试过 APE(Ajax 推送引擎),但当时他们还没有 SpiderMonkey/JavaScript 支持,客户端只有 Mootools,所以 GWT 的体验不是那么好.现在看看这个项目,它更加成熟并且已经做了很多(他们承诺的事情;)).我最喜欢 NGiNX_HTTP_Push_Module 纯粹是因为它似乎是最轻量级"的——协议和它使用的服务器(nginx 以快速并且能够同时处理许多连接而闻名——这在使用 Comet 时非常重要,因为您将有许多客户端一直在连接上挂起",等待来自服务器的数据).

Depending on your server side you have many options - cometd is a solid solution, but the Bayeux protocol they use is a little nightmare, TBH. I've tried APE (Ajax Push Engine) some months ago, but at that time they didn't have SpiderMonkey/JavaScript support yet and only Mootools on the client side, so the experience with GWT wasn't so good. Looking at the project now, it's more mature and a lot of has been done (of the things that they promised ;)). I like NGiNX_HTTP_Push_Module the best purely because it seems the "lightest" of the bunch - both protocol and the server it uses (nginx is known for being fast and able to handle many connections at time - something which is very important when using Comet, since you'll have many clients "hanging" on connections all the time, waiting for data from the server).

呸,对不起,文字墙,希望它会有所帮助(希望这就是你要找的:D).

Phew, sorry for the wall of text, hopefully it will be helpful (and hopefully that's what you were looking for :D).

这篇关于在 GWT 中调用什么来使 2 UI 保持一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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