Implement Comet / Server push in Google App Engine in Python

ぐ巨炮叔叔 提交于 2019-12-31 10:30:37

问题


How can I implement Comet / Server push in Google App Engine in Python?


回答1:


We just announced the Channel API to do comet push with App Engine apps: http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html

If you're at Google IO, I'll be talking about this at 1pm tomorrow (on the APIs track): http://code.google.com/events/io/2010/sessions/building-real-time-apps-app-engine-feed-api.html

Here's the YouTube video of the session: http://www.youtube.com/watch?v=oMXe-xK0BWA

Hopefully last update! This is now released: code.google.com/appengine/docs/python/channel




回答2:


At this time, I would rule out doing Comet in App Engine (any language). Comet is based on long-lived HTTP connections, and App Engine will time out any single connection in about 30 seconds or so at most; it's hard to conceive of a worse match!




回答3:


Comet (or something like it - XMPP API) is on the google app engine roadmap. For now, stay away.

http://code.google.com/appengine/docs/roadmap.html




回答4:


30 seconds is more than enough; either way you should return a no-op message when a time passed and no new events occur.

This prevents client timeouts and is done by everybody who does comet.

Just send the request, and on the server make it wait until an event or timeout after 25 seconds.




回答5:


Looking inside the App Engine 1.3.8-pre release, I see the Channel API service stub and more code. So it looks like we can start trying it out locally.




回答6:


Google App Engine supports server push using the Channel API since 2nd December.



来源:https://stackoverflow.com/questions/1285150/implement-comet-server-push-in-google-app-engine-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!