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

    Non-blocking IDataProvider.Subscribe

    Hi,

    We are in a process of refactoring our current .NET data adapter which will change the current synchronous (blocking) implementation of the IDataProvider.Subscribe method with an asynchronous (non-blocking) one.

    As the LS docs say that a non-blocking Subscribe method is recommended, how should we handle invalid subscription requests which will now be queued and handled in a different thread than the one that called Subscribe ? (currently we throw a SubscriptionException in the Subscribe method)

    Thanks

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    The recommendation for a non-blocking implementation of Subscribe is made for the java adapter interface, on which the Data Adapter runs in-process with the Server.
    For remote Data Adapter the requirement on Subscribe has been relieved (you may have found a stronger one for older versions of the .NET adapter interface).
    Anyway, in order to invoke Subscribe, Lightstreamer library needs to spawn a thread for each call (and to enqueue calls for the same item). So, if you can find a way to keep the invoking thread busy for a short time, this should be beneficial.

    Actually, sending a SubscriptionException is not very different from just not sending updates, as the information is not forwarded to the clients. By sending a SubscriptionException you mainly avoid to receive a redundand Unsubscribe.
    So, if you defer the management of Subscribe, you should not have problems.

 

 

Similar Threads

  1. Automatic subscribe to different items
    By abhijeetgk in forum Adapter SDKs
    Replies: 1
    Last Post: September 28th, 2011, 11:53 AM
  2. Replies: 1
    Last Post: October 21st, 2009, 11:19 AM
  3. dynamically subscribe items
    By rd2008 in forum General
    Replies: 9
    Last Post: October 10th, 2008, 11:38 AM
  4. subscribe to items not using threads
    By nagakumaran in forum Adapter SDKs
    Replies: 6
    Last Post: October 16th, 2007, 03:11 PM

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 11:20 AM.