-
April 8th, 2010, 07:48 AM
#1
Hi
Thank you very much for your reply,
Following are my queries as a newbie on here (it may very simple one),
How to disconnect the engine? I tried to access the engine object out side of this method. But all of my effort lead me on wrong path (I think).
Yes, as you said, creates the Engine, supplies the credentials, starts streaming and subscribes to a table altogether. Due to I have no idea about, how to access the engine object out side this function I keep all the effort in one place. Kindly advice me, how to split this method too. Thank you.
-
April 9th, 2010, 08:58 AM
#2
A pointer to the Engine is received when your onEngineCreation callback is invoked by Lightstreamer library.
I see that the callback saves the pointer to $wnd.lsEngine;
this is the pointer you can use afterwards to invoke all methods targeted to the Engine,
like: $wnd.lsEngine.changeStatus("DISCONNECTED") to disconnect.
If you did that, it should have worked.
Note that the general way of managing the lifecycle of the Engine pointer is slightly different and has to be followed in case you have multiple pages sharing the Engine; it consists of:
- implementing the onEngineReady callback and saving the pointer there (onEngineReady is similar to onEngineCreation, but it is invoked also when the page already finds an Engine and just shares it).
- implementing the onEngineLost callback to just clear the pointer (in fact, if a different page holds the shared Engine and gets closed, the Engine may be temporarily unavailable to the other pages).
I didn't really mean that your init method had better be split.
In general, the PushPage and Engine initialization code is separated from the table creation and subscription code. After creating and configuring the PushPage object, you can save the pointer (as you do, in $wnd.page) and use it later when you generate the cells on the page and create the Table object.
Similar Threads
-
By mohamida in forum Client SDKs
Replies: 10
Last Post: August 18th, 2010, 12:50 PM
-
By mohamida in forum Client SDKs
Replies: 10
Last Post: August 18th, 2010, 12:50 PM
-
By lstest in forum Adapter SDKs
Replies: 2
Last Post: February 24th, 2010, 11:09 AM
-
By jweber in forum Client SDKs
Replies: 10
Last Post: February 10th, 2010, 09:25 AM
-
By CitiMan in forum Adapter SDKs
Replies: 8
Last Post: November 30th, 2006, 04:26 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 04:01 PM.
Bookmarks