Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Mumbai
    Posts
    4

    subscribe to items not using threads

    Hi
    I have created a .net adapter using the "burst.cs" and "standalone.cs". The adapter is working fine. But for subscribing to every items a new thread is created ie in the subscribe function of the BurstTestAdapter class for every request of new items, a new thread is created. so if my page contains 1000 items(let us say), 1000 new threads will be created. I don't want to do like that. i m trying to update the items in only one thread for any number of items subscribed. but didn't find a way yet

    Regards,
    naga

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Hi Naga,

    consider that the purpose of all example code provided is that of showing how the API interface can be used. For this reason, the code is kept as simple as possible and it is not designed for efficiency.
    In the case of "burst.cs", the aim of the source is to provide a simulation for a feed with a very high update rate, though it only supports a very low number of items.

    I'm afraid that nothing is available from our example code in order to setup such an Adapter.

    Dario

  3. #3
    Member
    Join Date
    Sep 2007
    Location
    Mumbai
    Posts
    4

    Post

    Thanks for ur reply
    I checked with the "externalfeed.cs" and "stocklist.cs" also in that code also it is done like that in "burst.cs". It is generating updates very fast for 15 items subscribed. i agree with that. but i want to do the same thing with a single thread. is it possible to do like that.
    In the example code an instance for the interface IItemEventListener is created in the class BurstProducer. but i can't find the implementation for the interface in the example code. any way i have to check the efficiency if i load more number of items at the same time. is it possible to subscribe to multiple items using a single thread. ie instead of sending data for each item, i have to send data for the entire items subscribed and process the data in the html and update the table accordingly.
    also there is one java adapter used
    "com.lightstreamer.adapters.remote.data.Networ ked DataProvider"
    I am not able to create my own adapter like that. I am not able to find the source for that.
    in need of ur help at the moment
    naga

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Hi Naga

    Refer to page 3 of the included DOCS-SDKs\sdk_adapter_dotnet\doc\DotNet Adapters.pdf for an overview of the involved architecture.
    The "Proxy Data Adapter" is provided by Lightstreamer to forward all requests to the remote part. It is implemented as the "NetworkedDataProvider" class and its source code is not provided.
    The "Remote .NET Adapter Server" is also provided by Lightstreamer and its job is to load and manage the "Remote .NET Data Adapter", which is the only part that has to be written by you. The "Remote .NET Adapter Server" contains the definition of the API classes; again, the source code of the API classes is not provided, whereas their documentation is provided in DOCS-SDKs\sdk_adapter_dotnet\doc\DotNetAdapterAPI.chm.

    Your goal is still unclear to me. Is the sentence
    is it possible to subscribe to multiple items using a single thread
    referred to the client side? May you please expand on this? Also, please check if your case is the one addressed by COMMAND mode (see chapter 3.1 in DOCS-SDKs\General Concepts.pdf).

    Dario

  5. #5
    Member
    Join Date
    Sep 2007
    Location
    Mumbai
    Posts
    4

    Post

    Hi
    What is the problem is to subscribe for each item that we define in the html(i used the sdk_clientweb\doc\tutorial_resources to create a test webapp), a new thread starts in the Subscribe method defined in the "burst.cs". what i want is for the total number of items we define in the html page like "item1, item2, ...itemn(n is constant so i use merge mode only i am not using command mode right now)", only one thread should start in the subscribe method.

    In the "/stocklistdemo/index.html" there is one object used "updateItem" but i can't find the definition of it.
    and for the same item, i am having two fields (say buyprice, sellprice") the value of the two fields vary differently ie for a give particular instance, if both the values decreases, then i have to update the buy price field by green color and sell price field by red color. But now the background color changes for the total row corresponding to the updated items(either by green or red). can u give info regarding this.

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Hi Naga,

    the "updateItem" event handler is defined at line 152 in "/stocklistdemo/index.html".
    Together with the "formatValues" event handler, defined at line 192, they take care of formatting the displayed fields based on the field values. By using the "setRowAttribute" and "setAttribute" APIs properly, you can change the behaviour to suit your needs. The full API documentation of the provided javascript library is available in DOCS-SDKs\sdk_client_web\doc\jsdoc.

    The above answers to the Lightstreamer-related part of the question.
    About how a scalable version of our sample data generator can be designed, we leave the question open to any contributor.

    Dario

  7. #7
    Member
    Join Date
    Sep 2007
    Location
    Mumbai
    Posts
    4
    Thanks for ur reply.
    I find the definition of "setAttribute". I am now able to change the background colors of the cells individually. Its working fine.

 

 

Similar Threads

  1. Total JVM Threads
    By faa666 in forum General
    Replies: 1
    Last Post: February 20th, 2012, 10:53 AM
  2. Automatic subscribe to different items
    By abhijeetgk in forum Adapter APIs
    Replies: 1
    Last Post: September 28th, 2011, 11:53 AM
  3. Non-blocking IDataProvider.Subscribe
    By bartol82 in forum Adapter APIs
    Replies: 1
    Last Post: August 30th, 2011, 11:15 AM
  4. Calling IItemEventListener.Update from multiple threads
    By lizsedley in forum Adapter APIs
    Replies: 1
    Last Post: January 22nd, 2010, 03:16 PM
  5. dynamically subscribe items
    By rd2008 in forum General
    Replies: 9
    Last Post: October 10th, 2008, 11:38 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 02:39 PM.