Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for Google App Engine

You're reading from   Python for Google App Engine Master the full range of development features provided by Google App Engine to build and run scalable web applications in Python

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher Packt
ISBN-13 9781784398194
Length 198 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Massimiliano Pippi Massimiliano Pippi
Author Profile Icon Massimiliano Pippi
Massimiliano Pippi
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started FREE CHAPTER 2. A More Complex Application 3. Storing and Processing Users' Data 4. Improving Application Performance 5. Storing Data in Google Cloud SQL 6. Using Channels to Implement a Real-time Application 7. Building an Application with Django 8. Exposing a REST API with Google Cloud Endpoints Index

Tracking connections and disconnections

An App Engine application is responsible for the creation of channels and the transmission of the token, but it doesn't know whether the JavaScript client is connected or not. For example, our Notes application sends a message upon the creation of a new note through the inbound e-mail service, but on the other side, the JavaScript client might or might not receive it. In some contexts, this is not an issue, but there are several use cases where an App Engine application needs to know when a client connects or disconnects from a channel.

To enable channel notifications, we first need to enable inbound Channel presence service. To do this, we have to change our app.yaml configuration file by adding the following code:

inbound_services:
- mail
- channel_presence

Now that the presence service is enabled, our Notes application will receive HTTP POST requests to the following URLs:

  • The /_ah/channel/connected/ URL: When a JavaScript client has connected...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime