它在 GWT 中调用了什么来使 2 个 UI 保持一致?

发布于 2024-08-24 19:52:43 字数 167 浏览 2 评论 0原文

我观看了 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?

Thank you very much

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

稀香 2024-08-31 19:52:43

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

至于这个概念的实现:

  • rocket-gwt 具有 远程处理模块
  • cometd 是一个受欢迎且经验丰富的竞争对手 ;)
  • Ajax 推送Engine 是一个相对较新的补充 - 他们设计了自己的服务器(用 C 编写得很好),它可能会或可能不会提供比其他解决方案更好的性能,缺点是服务器端可能更难实现(要么编写C 或服务器端 JavaScript 中的模块(通过 SpiderMonkey)。 注意:APE 服务器只能在 Linux、BSD 或 Mac OS X 上运行。
  • NGiNX_HTTP_Push_Module - 我最喜欢的,因为他们的协议是最简单/最干净的,他们使用 nginx,这意味着不需要运行额外的服务器(并且不需要 Java 服务器 - 对于像我这样不使用 Java 的人很有用在服务器端)。该协议非常简单,纯 GWT 实现应该很容易编写(事实上,这就是我正在做的事情)。

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

唷,抱歉,文字墙很长,希望它会有所帮助(希望这就是您正在寻找的:D)。

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.

As for the implementations of this concept:

  • 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).

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).

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

纵情客 2024-08-31 19:52:43

您是在谈论两个或更多人可以在不同的计算机上一起工作,以便他们都对同一个文档进行更改吗?这通常被称为“协作软件”。 “协作”意味着共同努力。

您可能想看看 google Wave,它简化了此类软件的开发。

Are you talking about when two or more people can work together from different computers, so they are both making changes to the same document? This is usually called "collaborative software". To "collaborate" means to work together.

You might want to take a look at google Wave, which eases the development of this kind of software.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文