Remove reference to key and add pin overview

This commit is contained in:
Ian Gulliver
2014-05-25 23:55:42 -07:00
parent 2ec0402962
commit 8d1d79ef58
2 changed files with 11 additions and 11 deletions

View File

@@ -14,7 +14,7 @@
<div class="wrapper"> <div class="wrapper">
<header> <header>
<h1 class="header">Cosmopolite</h1> <h1 class="header">Cosmopolite</h1>
<p class="header">Client/server publish/subscribe and key/value storage for AppEngine</p> <p class="header">Client/server publish/subscribe, presence and key/value storage for AppEngine</p>
<ul> <ul>
<li class="download"><a class="buttons" href="https://github.com/flamingcowtv/cosmopolite/zipball/master">Download ZIP</a></li> <li class="download"><a class="buttons" href="https://github.com/flamingcowtv/cosmopolite/zipball/master">Download ZIP</a></li>
@@ -27,7 +27,7 @@
<h1> <h1>
<a name="cosmopolite" class="anchor" href="#cosmopolite"><span class="octicon octicon-link"></span></a>Cosmopolite</h1> <a name="cosmopolite" class="anchor" href="#cosmopolite"><span class="octicon octicon-link"></span></a>Cosmopolite</h1>
<p>Client/server publish/subscribe and key/value storage for <a href="https://developers.google.com/appengine/">AppEngine</a>.</p> <p>Client/server publish/subscribe, presence and key/value storage for <a href="https://developers.google.com/appengine/">AppEngine</a>.</p>
<h3>Dig in</h3> <h3>Dig in</h3>
@@ -48,7 +48,7 @@
<ul> <ul>
<li>Near-realtime notification to subscribers of messages published to a "subject"</li> <li>Near-realtime notification to subscribers of messages published to a "subject"</li>
<li>Server-side storage of past messages for replay later to clients</li> <li>Server-side storage of past messages for replay later to clients</li>
<li>Support for associating a key with a message and for lookup of the most recent message for a given key</li> <li>Ephemeral messages tied to client connection that can be used for presence information</li>
<li>Client identification persistence via <a href="http://www.w3schools.com/html/html5_webstorage.asp">localStorage</a> tokens or in combination with <a href="https://developers.google.com/appengine/docs/python/users/">Google account signin</a></li> <li>Client identification persistence via <a href="http://www.w3schools.com/html/html5_webstorage.asp">localStorage</a> tokens or in combination with <a href="https://developers.google.com/appengine/docs/python/users/">Google account signin</a></li>
<li>Complex messages supported via transparent <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON">JSON</a> serialization</li> <li>Complex messages supported via transparent <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON">JSON</a> serialization</li>
<li>Server-side strict ordering of messages</li> <li>Server-side strict ordering of messages</li>

View File

@@ -14,7 +14,7 @@
<div class="wrapper"> <div class="wrapper">
<header> <header>
<h1 class="header">Cosmopolite</h1> <h1 class="header">Cosmopolite</h1>
<p class="header">Client/server publish/subscribe and key/value storage for AppEngine</p> <p class="header">Client/server publish/subscribe, presence and key/value storage for AppEngine</p>
<ul> <ul>
<li class="download"><a class="buttons" href="https://github.com/flamingcowtv/cosmopolite/zipball/master">Download ZIP</a></li> <li class="download"><a class="buttons" href="https://github.com/flamingcowtv/cosmopolite/zipball/master">Download ZIP</a></li>
@@ -86,7 +86,7 @@ cosmo.sendMessage('testsubject', 'test message');</pre></li>
<ol> <ol>
<li><b>Subject</b>: a topic that clients that publish and subscribe to, e.g. "books"</li> <li><b>Subject</b>: a topic that clients that publish and subscribe to, e.g. "books"</li>
<li><b>Message</b>: a single chunk of data transmitted to a single subject, e.g. "I love books!"</li> <li><b>Message</b>: a single chunk of data transmitted to a single subject, e.g. "I love books!"</li>
<li><b>Key</b>: an optional string associated with a message, that can be used to look up the last message with a given key, e.g. "title" (key) = "A place to talk about books" (message)</li> <li><b>Pin</b>: an ephemeral message that is deleted when the client that pinned it disconnects</li>
<li><b>Instance</b>: a single instantiation of Cosmopolite() in a browser (destroyed on page close)</li> <li><b>Instance</b>: a single instantiation of Cosmopolite() in a browser (destroyed on page close)</li>
<li><b>Client</b>: a persistent identifier for a browser (consistent across browser restarts)</li> <li><b>Client</b>: a persistent identifier for a browser (consistent across browser restarts)</li>
<li><b>Profile</b>: a collection of clients that all speak as the same user (and so should appear the same to subscribers)</li> <li><b>Profile</b>: a collection of clients that all speak as the same user (and so should appear the same to subscribers)</li>
@@ -108,18 +108,18 @@ cosmo.subscribe('testsubject');</pre></li>
<li>Your test page should generate an alert popup</li> <li>Your test page should generate an alert popup</li>
</ol> </ol>
<h3>Using keys</h3> <h3>Key/value store</h3>
<ol> <ol>
<li>Cosmopolite can be used as a key/value store, with historical data and update notification</li> <li>Cosmopolite can be used as a key/value store, with historical data and update notification</li>
<li>Use the debug interface to send several messages to <i>testsubject</i>. Some of them should have the key <i>testkey</i>, while others should have different keys or no key.</li> <li>When subscribing to a subject, you can request the most recent message for that subject</li>
<li>Change your test script: <li>Change your test script:
<pre>var cosmo = new Cosmopolite(); <pre>var cosmo = new Cosmopolite();
cosmo.subscribe('testsubject', 0, null, ['testkey']).then(function() { cosmo.subscribe('testsubject', 1).then(function() {
var msg = cosmo.getKeyMessage('testsubject', 'testkey'); var msgs = cosmo.getMessages('testsubject');
alert(msg['message']); alert(msgs[msgs.length - 1]['message']);
});</pre></li> });</pre></li>
<li>Your test page should generate an alert popup showing the last message sent with that key</li> <li>Your test page should generate an alert popup showing the last message sent</li>
</ol> </ol>
</section> </section>