English 中文(简体)
GWT + GAE python: frameworks for COMET & RPC
原标题:

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?

最佳回答

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.

问题回答

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

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.

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.





相关问题
How to make logging.debug work on Appengine?

I m having a tough time getting the logging on Appengine working. the statement import logging is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an ...

gqlQuery returns object, want list of keys

Is there a way to convert the GqlQuery object to an array of keys, or is there a way to force the query to return an array of keys? For example: items = db.GqlQuery("SELECT __key__ FROM Items") ...

Integrating Google AppEngine with a Thick Client

I want to make a multi-user client-server solution with Java Swing thick client as a front-end and Google AppEngine (Java one) as a back-end. The problem is that GAE provides only web-based forms for ...

sorl.thumbnail : thumbnail is not a valid tag library?

I am trying to install sorl.thumbnail but am getting the following error message: thumbnail is not a valid tag library: Could not load template library from django.templatetags.thumbnail, No module ...

热门标签