Results 1 to 4 of 4

Hybrid View

  1. #1
    Member
    Join Date
    Mar 2010
    Location
    Madurai
    Posts
    12
    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.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    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

  1. createEngine should be in the BODY ??
    By mohamida in forum Client SDKs
    Replies: 10
    Last Post: August 18th, 2010, 12:50 PM
  2. createEngine should be in the BODY ??
    By mohamida in forum Client SDKs
    Replies: 10
    Last Post: August 18th, 2010, 12:50 PM
  3. notifySessionClose sometimes not being called
    By lstest in forum Adapter SDKs
    Replies: 2
    Last Post: February 24th, 2010, 11:09 AM
  4. Table.onEndOfSnapshot not being called
    By jweber in forum Client SDKs
    Replies: 10
    Last Post: February 10th, 2010, 09:25 AM
  5. Data Adapter's subscribe() method not getting called
    By CitiMan in forum Adapter SDKs
    Replies: 8
    Last Post: November 30th, 2006, 04:26 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 04:01 PM.