-
April 21st, 2010, 11:38 AM
#1
As i said before, the data are being added to the stockGenerators variable (it takes some times), so when the subscribe function is called, it will not send anything to Lightstreamer server (because that item is not found "yet" in stockGenerators variable), so myFeed.sendCurrentValues(itemName); will return nothing. That's why data will not be shown in the browser.
I think it will be shown only when you refresh the session (after you close the browser, and wait a while).
Is there a solution to call the subscribe function when you refresh the page ? Or is there a way when you close the browser or page, you kill the session ( so i don't have to wait some time before the session get killed) ?
-
April 21st, 2010, 04:19 PM
#2
Is there a solution to call the subscribe function when you refresh the page?
No, there isn't, the subscribe method for a certain item on the data adapter is called when such item is subscribed by a client for the first time while the unsubscribe call for the same item is called when the last client subscribed to that item closes its session (or explicitly unsubscribes from the item).
eg: admitting a just started server, if a clients subscribes to itemX then subscribe for itemX is called on the adapter, but if a second client subscribes to itemX too the subscribe method is not called again. After that, even if the first client closes its session, the unsubscribe for itemX is not called because the second client is still subscribed.
So you can't govern the subscribe/unsubscribe call through a client as other clients may interferer.
The solution to your issue would be to track the subscribed items so that when stockGenerators is filled for the first time, if an item is already subscribed, you will be able to send the updates to the server as soon as them are available, so that the server in turn will send them to the connected clients.
HTH
-
April 21st, 2010, 08:17 PM
#3
Similar Threads
-
By pratik in forum Client SDKs
Replies: 4
Last Post: June 26th, 2015, 08:56 AM
-
By latha in forum Client SDKs
Replies: 6
Last Post: December 7th, 2010, 09:26 AM
-
By latha in forum Client SDKs
Replies: 1
Last Post: January 18th, 2010, 03:27 PM
-
By mnenchev in forum General
Replies: 3
Last Post: September 29th, 2009, 08:54 AM
-
By ctranfd in forum Client SDKs
Replies: 3
Last Post: June 5th, 2009, 11:45 AM
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:19 PM.
Bookmarks