Latest post Tue, Apr 15 2014 1:31 PM by akellogg. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • Mon, Apr 14 2014 8:19 PM

    • akellogg
    • Not Ranked
    • Joined on Mon, Apr 14 2014
    • Posts 5
    • Points 55

    How to monitor an iNews queue for changes to any story

    Hello,

    I have written a simple C# application that can read and process all stories in a queue but we don't want to do this unless we know there is a change. Is there a way to monitor a queue for changes to any story within it - if there is an update/delete/addition to any of the stories contained in the queue I would like to be informed of this.  

    We want to do this to avoid the time it takes to read and process the contents of 100's of stories in a queue if there is no change from the previous request.  This will greatly improve the performance of our Web API application - we can simply return a cached version of the processed queue to the user without  going to the expense and elapsed time to read the queue using the iNews web service.

    Thanks in advance

     

    Filed under: , ,
  • Mon, Apr 14 2014 8:41 PM In reply to

    • fiatala
    • Not Ranked
    • Joined on Fri, Jun 7 2013
    • Posts 16
    • Points 165

    Re: How to monitor an iNews queue for changes to any story

    [ editing because the post did not respect my formatting bullets ]

    There is not a way to register for specific stories. Cache maintenance and validation are as follows.

    The queue must be a "refresh" queue. All rundowns are refresh, but other queues may not be. Using SHOW.TRAINING.RUNDOWN as an example...

    WatchQueueForChanges -> SHOW.TRAINING.RUNDOWN ... This tells the server to track the queue for you.

    GetQueueRecords -> SHOW.TRAINING.RUNDOWN ... The server response to this is a list of all stories in the queue, returning their storyID, qlocator, and modified time. 200 max per request, so you'll have to loop until you reach the end. The payload is much, much smaller than a getStories payload.

    GetChangedQueues ... On a timed interval (five seconds, or whatever).

    If SHOW.TRAINING.RUNDOWN appears in the GetChangedQueues response, then GetQueueRecords -> SHOW.TRAINING.RUNDOWN. 

    .. If the first segment of a queue locator is not in your cache, it's a new story.
    .. If the first segment of a queue locator is in your cache but the storyID is different, it's a modified story.
    .. If the mtime of a story has changed, the story was modified.
    .. If a queue locator is missing, the story was deleted.
    .. A reorder is not a modification. If a queue locator moves somewhere else in the queue but the mtime and storyID do not change you can just update the position in your cache.
    .. The second and third segments of queue locators will change. Those are search optimizers so the server can retrieve the story faster. Those segments can change values as a result of other operations in the queue. You do not need to retrieve a story just because one of those segments changes, but you may want to update your cache to contain the new locator segments.

     

  • Tue, Apr 15 2014 1:31 PM In reply to

    • akellogg
    • Not Ranked
    • Joined on Mon, Apr 14 2014
    • Posts 5
    • Points 55

    Re: How to monitor an iNews queue for changes to any story

    Thanks so much! This is exactly what I was looking for.  This should improve the performance of our Web API significantly.

Page 1 of 1 (3 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller