Thursday, October 30, 2014

Re: Initiate sending over RPC from the server side

Hi,

We have built several systems like this where we want to push data to clients from the server. The client is responsible for subscribing to a channel possibly with filters in place. Rather than use GWT-RPC we have tended to move to using raw messages that are typically json blobs. We have used 4 basic strategies depending on the clients supported and the application requirements. The strategies are;

1. WebSockets
2. Server-Sent Events
3. Long polling
4. Periodic Polling

I had a poke around and found a good stack overflow answer to this (See [1])

When we faced the same issues, we ended up putting together a couple of libraries to help with in GWT.

* websockets: https://github.com/realityforge/gwt-websockets
* Server-sent Events: https://github.com/realityforge/gwt-eventsource
* Polling: https://github.com/realityforge/gwt-webpoller (Warning this
API is not yet at 1.0 status)

The tricky part is actually managing the channels and messages sequencing in each channel but we never got arounf to releasing our code for that part of the problem.

On Fri, Oct 31, 2014 at 3:28 AM, Larry L <weijenli@gmail.com> wrote:

Hello,

I'm new to GWT RPC. I need to write something that I subscribe on the client side then on the server side it can send data to client whenever there is update.
As I read from the tutorial, I make a Service interface and a ServiceAsync interface on the client, and a ServiceImpl on the server side that implements Service.

And then, on the client side I just call service.xxx and catch the return from my AsyncCallback.
This is like I trigger the event from the client side and pull some data from the server side.

Is there a way to "push" the data from the server side and send the data to every client that "subscribes" it?

Thanks,
Larry

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.



--
Cheers,

Peter Donald

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment