GWT + GAE python:COMET 和 GAE 框架远程过程调用

发布于 2024-08-14 17:11:54 字数 122 浏览 2 评论 0原文

假设我想在客户端使用 Google GWT,在服务器端使用 Google AppEngine Python。此外,我希望能够使用 RPC 调用服务器以及执行基于 COMET 的交换。

就现有框架而言,我有哪些选择?

Let's say I want to use Google GWT on the client side and Google AppEngine Python on the server side. Furthermore, I want to be able to use RPC calls to the server as well as performing COMET based exchanges.

What are my options in term of existing frameworks?

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

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

发布评论

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

评论(4

反差帅 2024-08-21 17:11:54

我通过谷歌搜索“gwt python”找到了这个: http://code.google.com /p/python-gwt-rpc/ —— 它似乎不受支持,因为 App Engine 现在支持 Java。

通过谷歌搜索“gwt comet”:http://code.google.com/p/ Rocket-gwt——它应该在你的客户端工作,以便将 GET 挂到服务器上,这可以用 Python 编写。

但我不得不说,如果你只用 Java 编写服务器端,那么做到这一点会容易得多。 GWT 和 Java 是天生一对,它们是一体的,除非您对用 Java 编写服务器有强烈的反感,否则您应该真正考虑一下它。

您可以将一些解决方案组合在一起,使 GWT 和 Python 一起工作,但它很容易在即将推出的 GWT 版本中出现问题,从长远来看,这意味着您需要做更多的工作。

只需用Java编写服务器即可。

I found this by googling "gwt python": http://code.google.com/p/python-gwt-rpc/ -- it appears to be unsupported, since App Engine supports Java now.

And this, by googling "gwt comet": http://code.google.com/p/rocket-gwt -- which should work on your client-side to make hanging GETs to the server, which conceivably could be written in Python.

But I have to say, it's going to be a lot easier to do this if you just write the server-side in Java. GWT and Java were made for eachother, they belong together, and unless you've got some strong aversion to writing the server in Java, you should really consider it.

You could hack some solution together to make GWT and Python work together, but it could easily break in upcoming versions of GWT, meaning more work for you in the long run.

Just write the server in Java.

北笙凉宸 2024-08-21 17:11:54

一年后,GAE 中提供的新 Channel API 允许这种持久连接,以避免在 JavaPython

Channel API 在您的应用程序和 Google 服务器之间创建持久连接,允许您的应用程序无需使用轮询即可向 JavaScript 客户端实时发送消息。这对于旨在向用户更新新信息的应用程序非常有用。一些示例包括协作应用程序、多人游戏和聊天室。一般来说,在无法预测或更新的情况下,使用 Channel API 是比轮询更好的选择。脚本化,例如在人类用户之间传递信息或从非系统生成的事件中传递信息时。

One year later, the new Channel API available in GAE allows this kind of persistent connections to avoid polling both in Java and Python.

"The Channel API creates a persistent connection between your application and Google servers, allowing your application to send messages to JavaScript clients in real time without the use of polling. This is useful for applications that are designed to update the user about new information immediately or where user input is immediately broadcast to other users. Some examples include collaborative applications, multi-player games, and chat rooms. In general, using Channel API is a better choice than polling in situations where updates can't be predicted or scripted, such as when relaying information between human users or from events not generated systematically."

┾廆蒐ゝ 2024-08-21 17:11:54

App Engine 目前不支持 comet,因为它不支持挂起的 GET(例如,长时间运行的请求)。如果您想做 Comet,则必须使用外部服务,或者等待 App Engine 中的 Comet 支持。

App Engine doesn't currently support comet, because it doesn't support hanging-GETs (eg, long-running requests). If you want to do comet, you'll have to use an external service, or wait for Comet support in App Engine.

木緿 2024-08-21 17:11:54

您可以借助一项微小的额外服务(我免费托管一个)来完成此操作:

http://www.brightyellowcow.com/blog/Comet-AJAX-push-using-PHP-or-Google-App-Engine.html

该服务的唯一的工作是唤醒客户端应用程序,它使用长轮询的 ajax 请求来完成此操作。当有新数据上传时,您的 App Engine 应用程序会通过 http 推送服务,这会导致客户端唤醒并返回到 App Engine 应用程序以获取新数据。

You can do it with the help of a tiny extra service (I host one for free):

http://www.brightyellowcow.com/blog/Comet-AJAX-push-using-PHP-or-Google-App-Engine.html

The service's sole job is to provide a wake up to the client application, and it does this using a long polled ajax request. Your App engine application pokes the service via http when there is new data uploaded, which causes the client to wake up and go back to the app engine application for the new data.

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