Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
The channel package implements the server side of App Engine's Channel API.
Create creates a new channel associated with the given clientID, which must be unique to the client that will use the returned token.
token, err := channel.Create(c, "player1") if err != nil { // handle error } // return token to the client in an HTTP response
Send sends a message to the client over the channel identified by clientID.
channel.Send(c, "player1", "Game over!")
func Create(c appengine.Context, clientID string) (token string, err os.Error)
Create creates a channel and returns a token for use by the client. The clientID is an appication-provided string used to identify the client.
func Send(c appengine.Context, clientID, message string) os.Error
Send sends a message on the channel associated with clientID.
func SendJSON(c appengine.Context, clientID string, value interface{}) os.Error
SendJSON is a helper function that sends a JSON-encoded value on the channel associated with clientID.