Client/server publish/subscribe, presence and key/value storage for AppEngine
includes: - cosmopolite inbound_services: - channel_presence
<html>
<head>
<script src="/cosmopolite/static/cosmopolite.js" charset="UTF-8"></script>
</head>
<body>
<script>
// Subsequent script examples go here
</script>
</body>
</html>handlers: - url: /test.html static_files: test.html upload: test.html
var cosmo = new Cosmopolite();
cosmo.sendMessage('testsubject', 'test message');var callbacks = {
onMessage: function(msg) {
alert(msg['message']);
},
};
var cosmo = new Cosmopolite(callbacks);
cosmo.subscribe('testsubject');var cosmo = new Cosmopolite();
cosmo.subscribe('testsubject', 1).then(function() {
var msg = cosmo.getLastMessage('testsubject');
alert(msg['message']);
});var cosmo = new Cosmopolite();
cosmo.pin('testsubject', 'browser is alive!');