-
August 29th, 2011, 04:32 PM
#1
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
-
August 30th, 2011, 10:15 AM
#2
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
-
By abhijeetgk in forum Adapter SDKs
Replies: 1
Last Post: September 28th, 2011, 10:53 AM
-
By lizsedley in forum Client SDKs
Replies: 1
Last Post: October 21st, 2009, 10:19 AM
-
By rd2008 in forum General
Replies: 9
Last Post: October 10th, 2008, 10:38 AM
-
By nagakumaran in forum Adapter SDKs
Replies: 6
Last Post: October 16th, 2007, 02:11 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 10:51 PM.
Bookmarks