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

We just announced the Channel API to do comet push with App Engine apps:

If you’re at Google IO, I’ll be talking about this at 1pm tomorrow (on the APIs track):

Here’s the YouTube video of the session:

Hopefully last update! This is now released:

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!

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

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.

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.

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