Implementar Comet / Server push en Google App Engine en Python


¿Cómo puedo implementar Comet / Server push en Google App Engine en Python?

Author: Lev, 2009-08-16

6 answers

Acabamos de anunciar la API de canal para hacer comet push con App Engine apps: http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html

Si estás en Google IO, estaré hablando de esto a la 1pm mañana (en la pista APIs): http://code.google.com/events/io/2010/sessions/building-real-time-apps-app-engine-feed-api.html

Aquí está el video de YouTube de la sesión: http://www.youtube.com/watch?v=oMXe-xK0BWA

Con suerte última actualización! Esto ya está disponible: code.google.com/appengine/docs/python/channel

 69
Author: Moishe Lettvin,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-03-09 23:23:33

En este momento, descartaría hacer Comet en App Engine (cualquier idioma). Comet se basa en conexiones HTTP de larga duración, y App Engine agotará el tiempo de espera de cualquier conexión en aproximadamente 30 segundos como máximo; ¡es difícil concebir una coincidencia peor!

 3
Author: Alex Martelli,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-08-16 20:14:58

Comet (o algo parecido - XMPP API) está en la hoja de ruta del motor de Google app. Por ahora, aléjate.

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

 2
Author: mainsocial,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-08-17 02:14:21

30 segundos es más que suficiente; de cualquier manera debe devolver un mensaje de no-op cuando pase un tiempo y no ocurran nuevos eventos.

Esto evita los tiempos de espera del cliente y lo hacen todos los que hacen comet.

Simplemente envíe la solicitud, y en el servidor haga que espere hasta un evento o tiempo de espera después de 25 segundos.

 1
Author: Uriel Katz,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-01-10 16:53:36

Mirando dentro de la App Engine 1.3.8-pre release, veo el Canal API service stub y más código. Así que parece que podemos empezar a probarlo localmente.

 0
Author: kvdb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-12 20:19:03

Google App Engine soporta Server push usando la API de canal desde el 2 de diciembre.

 0
Author: Robber,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-12-19 00:03:00