gwt-channel-api icon indicating copy to clipboard operation
gwt-channel-api copied to clipboard

Missing ChannelListenerAsync.java

Open diarybooker opened this issue 10 years ago • 4 comments

I created one myself:

package no.eirikb.gwtchannelapi.client;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface ChannelListenerAsync { void onMessage(String message,AsyncCallback<Void> asyncCallback); void onOpen(AsyncCallback<Void> asyncCallback); void onError(int code, String description, AsyncCallback<Void> asyncCallback); void onClose(AsyncCallback<Void> asyncCallback); }

diarybooker avatar Jun 07 '15 18:06 diarybooker

Hi

Could be a pull request?

eirikb avatar Jun 07 '15 18:06 eirikb

Possibly, not quite sure how all that works.... I've never used github before, but I do now have a working version of your code, but I have edited it like crazy trying to get it working, so would have to start again to try to make it neater?!

Thanks MASSIVELY for helping me implement this in my product though, without this project I would never have figured it out!

diarybooker avatar Jun 07 '15 18:06 diarybooker

What did you have to change?

It's been a while since I worked on this project. Tried running the demo now, and it did not start with the normal mvn gwt:run. Noticed it was missing target/gwt-channel-api-demo-0.3-SNAPSHOT\WEB-INF/appengine-web.xml, so I tried copying that manually, and had to manually compile, after that the demo works.

Like this: cp -r src/main/webapp/* target/gwt-channel-api-demo-0.3-SNAPSHOT/ mvn gwt:compile mvn gwt:run

eirikb avatar Jun 07 '15 19:06 eirikb

It's possible I'm not doing it right or something, for a start I don't use Maven, so that might have an effect, but when I tried to compile it initially, it complained that there wasn't a Listener Async and then complained that there was no "onMessage" or "onjoin" defined on the server, beyond that I can't really remember what problems I had...

I have now added a second text box that allows you to subscribe to a second channel, which meant I could test 4 clients at the same time with two separate channels all interacting with the same server, then add a third channel to all 4 screens and have them all be fed by that channel!

I also added a 10 second delay and resent the message with a modifier so I could see asynchronous channel handling too

diarybooker avatar Jun 07 '15 21:06 diarybooker