The Channel API Functions (Python)

The Channel API provides the following functions in the module google.appengine.api.channel:

create_channel(client_id, duration_minutes=None)

Creates a channel. Returns a token for use by the JavaScript client listening on the channel.


An application-created string the server uses to identify individual JavaScript clients.
The number of minutes for which the returned token will be valid. If None, use default (120 minutes). If specified, the value must be greater than zero and less than 24 * 60.
send_message(client_id, message)

Asynchronously sends a message to a channel. No error is returned if the message cannot be delivered. If the client_id parameter is actually a token returned by a create_channel call then send_message can be used for different versions of the app. For instance you could create the channel on the front end and then send messages from a backend of the app.


The key identifying a JavaScript client. This can be the client_id used in a create_channel call or the token returned by such a call. The advantage of using the token is that send_message will work from a different version of the application than the one that created the channel.
The message passed to the client.