Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Mar 2008
    Location
    zagreb
    Posts
    5

    2 items with same data

    Hi,

    I'm developing a proof-of-concept .NET data adapter for LS and I'm still getting the hang of it so I apologise in front if I ask something obvious.

    As the adapter feeds the current stock data to LS clients, I definitely want to have an item in the MERGE mode for each of the listed stock, e.g. PLVA, ERNT. So far so good.
    But I would also like to have the ability for the clients to subscribe to an item that represents "all traded stocks for the current trading day". So I figured I need an item "ALL_TRADED" in the COMMAND mode, where I could ADD new stocks to the table as they get traded. The schema (fields) and the data of "ALL_TRADED" and every specific stock's items are identical. After a (too) long introduction my question would be is there a way to setup things so that if a subscription is made to the "ALL_TRADED" item I do not have to call listener's Update event for each of the specific stock's items that are already included in the "ALL_TRADED" item?

    Thanks.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    As far as I am concerned, the introduction is not too long; rather, the final question is a bit too short.
    If I understand well, you would like to save the management of the "ALL_TRADED" item in your Data Adapter, in particular because it would be a problem to provide the current snapshot at subscription time.

    Other aspects of the problem are unclear to me.

    Does the list of traded quotes include quotes that may have never been subscribed to by any client
    or a list based on the currently subscribed items would be enough?

    If Lightstreamer is started when the market is already open, can you ask your feed for the current list of traded items
    or generating an approximate list based on the trades occurred since Lightstreamer start would be enough?

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Sorry, perhaps you meant that you would like to avoid calling "Update" twice for each event you receive from the feed (once for the stock-specific item and once for the "ALL_TRADED" items).
    May you please confirm?

  4. #4
    Member
    Join Date
    Mar 2008
    Location
    zagreb
    Posts
    5
    Sorry for the (much) delayed answer, I got occupied with higher priority things.

    Yes, that is correct, I was wondering was there a way to avoid calling Update for each single stock subscription items and then again for the ALL_TRADED subscription, since the data is identical (minus "key" and "command" fields for the ALL_TRADED item)?

    But maybe this is a perfect example of a premature optimization attempt?

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    You could implement your ALL_TRADED item as only listing the stock-specific item names of the traded stocks;
    your client could get quote data for those items by second-level subscriptions driven by the ALL_TRADED item contents.

    This seems quite complicated, but, thanks to your delay, you can now take advantage of the MultiMetapush table support, introduced with the newly released Lightstreamer 3.5, which does just the above.

    This support is available for the Web Client Library and the Flex Client Library, both for visual and nonvisual tables.
    These libraries also take care of optimizing the process of performing many second-level subscriptions in short time.

 

 

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 10:54 AM.