Skip navigation
testing34
Currently Being Moderated

Implementing Server Push using LCDS 2.6

May 16, 2012 3:13 AM

Hi All,

 

We have created an application where we are using polling to get certain constant updates. Now this polling is client polling wherein the client polls the server at regular intervals to get the fresh data for certain actions.

 

Now we wish to take this to another level and implement Server Data Push so that the client does not keep polling unnecessarily and the server notifies the client as and when the data gets updated with the server. For this we have the DataService Transaction class that needs to be implemented.

 

But there are a couple of questions that are in my mind regarding this technology. It would be great if someone could answer them.

 

My questions are:

1) Does the LCDS server know which client to push data to in case of multiple clients looking at the same data scenario. e.g. Two clients A and B are looking at the same data. A performs an action and that action needs some time to get completed at the server. Now in case we use Server Data Push, will the LCDS be intelligent enough to send the message on completion of the requested activity to only A and not B.

 

2) In order to push data to the client, the server will invoke some method which will return the desired data to te client. How do we keep the parameters registered with the server that this method would need while getting invoked. SInce, the call to the method will not be client initiated, how does the server know what parameters to be passed to the method in order to invoke it. How will this work in a multi-user looking at the same data/screen scenario.

 

The answers to these questions will really help us. In case anyone is well versed with this technology, please pitch in to give your inputs.

 

Many Thanks.

 

Regards,

Shally

 
Replies
  • Currently Being Moderated
    May 16, 2012 10:19 AM   in reply to testing34

    Before we can answer, I think we need a little more detail...Are you trying to have LCDS be the point of contact to initiate an asynchronous third party service that will then come back and tell LCDS to use data push to alert the client that made the request that it has been completed?

     

    I think that is a little beyond the scope of LCDS's 'out of the box' capabilities...but not impossible at all

     

    To answer your questions though:

     

    1. No, LCDS out of the box will not know which client to push a message to automatically, but yes, you can send the response to a specific client through their client ID, and if you can track that ID by sending the ID off with your initial request to your third party service and have it return it back as well so your client can be pushed to.

     

    2. This is a little more complex and I think we need more detail before we can even begin to answer this one...

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2012 9:06 AM   in reply to testing34

    Okay, sounds like what I was expecting.  I could ramble on about how to achieve this using a custom implementation of push messaging, but I think that would actually be overkill..the simple answer is if you have access to LCDS then you have access to RTMP which allows for non-polling message topics.  Could you possibly setup a RTMP channel with subtopics enabled and each client that makes the request brings up a subtopic that the server will respond to when done?  Then you could use an asynchronous consumer on the client side to wait for the response?

     

    The only downside to this is that you have no idea of knowing if the client is still connected at that point...but I'm going to assume you can keep it in a message queue or database and instead of pushing the full data back automatically, just alert the client that they need to then make a request for the data once it is completed by posting a message on the topic...that way you know when they got the data and you can hold on to it until the next time the client hooks up and ping for any pending data

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points