Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jul 2007
    Location
    Stoneham
    Posts
    4

    Pre-Processor Snapshot vs DataAdapter Snapshot

    Hello all,
    One thing is not really clear to me from the documentation is that "Does the pre-processor maintain the initial snapshot to be sent to a client for the first time when he subscribes or does the data adapter need to maintain this state and call _listener.Update for the snapshot items at the point when the client subscribes?"
    Assuming MERGE mode is being used...
    Any responses are greatly appreciated..
    Regards,
    Sukhdev

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    The Data adapter should give the initial snapshot only as the first client subscribes to a certain item (the subscribe method is called on the DataAdapter). After than, until there is at least 1 client subscribed to that item the snapshot is completely handled by Lightstreamer. When no more clients are subscribed to that item the unsubscribe method is called on the DataAdapter. On the next subscription to that item the DataAdapter should send the snapshot events (the subscribe method is called again).

    Client 1 subscribes to item1 -> The DataAdapter sends the intial snapshot
    Client 2 subscribes to item1 -> Lightstreamer sends the initial snapshot
    Client 1 unsubscribes from item1
    Client 3 subscribes to item1 -> Lightstreamer sends the initial snapshot
    Client 2 unsubscribes from item1
    Client 3 unsubscribes from item1
    [no more clients subscribed to item 1]
    Client 4 subscribes to item1 -> The DataAdapter sends the intial snapshot
    And so on...

    In conclusion you should just send the snapshot any time the subscribe method is called for an item on the DataAdapter.

  3. #3
    Member
    Join Date
    Jul 2007
    Location
    Stoneham
    Posts
    4
    Quote Originally Posted by Mone
    Hello,

    The Data adapter should give the initial snapshot only as the first client subscribes to a certain item (the subscribe method is called on the DataAdapter). After than, until there is at least 1 client subscribed to that item the snapshot is completely handled by Lightstreamer. When no more clients are subscribed to that item the unsubscribe method is called on the DataAdapter. On the next subscription to that item the DataAdapter should send the snapshot events (the subscribe method is called again).

    Client 1 subscribes to item1 -> The DataAdapter sends the intial snapshot
    Client 2 subscribes to item1 -> Lightstreamer sends the initial snapshot
    Client 1 unsubscribes from item1
    Client 3 subscribes to item1 -> Lightstreamer sends the initial snapshot
    Client 2 unsubscribes from item1
    Client 3 unsubscribes from item1
    [no more clients subscribed to item 1]
    Client 4 subscribes to item1 -> The DataAdapter sends the intial snapshot
    And so on...

    In conclusion you should just send the snapshot any time the subscribe method is called for an item on the DataAdapter.
    Great, that really helps... How long is this snapshot held in the LightStreamer Server? Is there anyway to set a time period to expire this snapshot?
    Thank You,
    Sukhdev

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    In MERGE subscriptions the snapshot length is always 1, only the latest data per each item/field is stored.
    In COMMAND subscriptions the snapshot length is variable, the latest data per each key/field of each item is stored.
    In DISTINCT subscriptions the snapshot length is set by the MetadataProvider implementation (see
    http://www.lightstreamer.com/docs/...adataProvider.html#getDistinctSnapshotLength(ja va.lang.String)
    )

    The snapshot for an item is hold until there is someone subscribed to that item, there is no way to set a time-based expiry.

 

 

Similar Threads

  1. Snapshot Processing
    By wwatts in forum Client SDKs
    Replies: 3
    Last Post: October 2nd, 2012, 11:40 AM
  2. How to configure snapshot length?
    By LS_Developer in forum General
    Replies: 3
    Last Post: March 14th, 2012, 03:46 PM
  3. Snapshot Available
    By vaduganathan in forum Adapter SDKs
    Replies: 8
    Last Post: December 16th, 2010, 04:15 PM
  4. Initial snapshot length
    By patilgkk in forum General
    Replies: 5
    Last Post: August 2nd, 2010, 10:04 AM
  5. Snapshot example
    By patilgkk in forum Adapter SDKs
    Replies: 3
    Last Post: June 3rd, 2010, 11:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 03:03 PM.