From 8d1d79ef581f983c52aa6769c8eed9668525bf0f Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sun, 25 May 2014 23:55:42 -0700 Subject: [PATCH] Remove reference to key and add pin overview --- index.html | 6 +++--- tutorial.html | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 9fb2f94..d6e81cf 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@

Cosmopolite

-

Client/server publish/subscribe and key/value storage for AppEngine

+

Client/server publish/subscribe, presence and key/value storage for AppEngine

  • Download ZIP
  • @@ -27,7 +27,7 @@

    Cosmopolite

    -

    Client/server publish/subscribe and key/value storage for AppEngine.

    +

    Client/server publish/subscribe, presence and key/value storage for AppEngine.

    Dig in

    @@ -48,7 +48,7 @@
    • Near-realtime notification to subscribers of messages published to a "subject"
    • Server-side storage of past messages for replay later to clients
    • -
    • Support for associating a key with a message and for lookup of the most recent message for a given key
    • +
    • Ephemeral messages tied to client connection that can be used for presence information
    • Client identification persistence via localStorage tokens or in combination with Google account signin
    • Complex messages supported via transparent JSON serialization
    • Server-side strict ordering of messages
    • diff --git a/tutorial.html b/tutorial.html index 9e2db9a..df0a3a8 100644 --- a/tutorial.html +++ b/tutorial.html @@ -14,7 +14,7 @@

      Cosmopolite

      -

      Client/server publish/subscribe and key/value storage for AppEngine

      +

      Client/server publish/subscribe, presence and key/value storage for AppEngine

      • Download ZIP
      • @@ -86,7 +86,7 @@ cosmo.sendMessage('testsubject', 'test message');
        1. Subject: a topic that clients that publish and subscribe to, e.g. "books"
        2. Message: a single chunk of data transmitted to a single subject, e.g. "I love books!"
        3. -
        4. Key: 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)
        5. +
        6. Pin: an ephemeral message that is deleted when the client that pinned it disconnects
        7. Instance: a single instantiation of Cosmopolite() in a browser (destroyed on page close)
        8. Client: a persistent identifier for a browser (consistent across browser restarts)
        9. Profile: a collection of clients that all speak as the same user (and so should appear the same to subscribers)
        10. @@ -108,18 +108,18 @@ cosmo.subscribe('testsubject');
        11. Your test page should generate an alert popup
        -

        Using keys

        +

        Key/value store

        1. Cosmopolite can be used as a key/value store, with historical data and update notification
        2. -
        3. Use the debug interface to send several messages to testsubject. Some of them should have the key testkey, while others should have different keys or no key.
        4. +
        5. When subscribing to a subject, you can request the most recent message for that subject
        6. Change your test script:
          var cosmo = new Cosmopolite();
          -cosmo.subscribe('testsubject', 0, null, ['testkey']).then(function() {
          -  var msg = cosmo.getKeyMessage('testsubject', 'testkey');
          -  alert(msg['message']);
          +cosmo.subscribe('testsubject', 1).then(function() {
          +  var msgs = cosmo.getMessages('testsubject');
          +  alert(msgs[msgs.length - 1]['message']);
           });
        7. -
        8. Your test page should generate an alert popup showing the last message sent with that key
        9. +
        10. Your test page should generate an alert popup showing the last message sent