Open GoogleCodeExporter opened 8 years ago
I think what you see is a race condition which can not be handled by the
framework.
Where/when do you add the listener? The "problem" is, that the server is
already sending events before the listener is registered at the server side.
That could be a normal case, when the server is already running and a new
client accesses the page.
When you are starting the event execution logic along with the listener
registration and when you have to ensure that all these events are received
directly, then the application has to ensure that the listener is registered
before the events get sent. That can be done by using the optional callback
parameter of RemoteEventService#addListener(...). The server logic which sends
events shouldn't start before the onSuccess method of the callback is called.
I have attached a patch for HelloGWTEventService which "fixes" the problem, but
in that case it isn't important that all events get received (a new client will
also not get all previous executed events since the server start).
I understand that this behavior isn't self-explanatory and the hint in chapter
3.3 of the manual isn't sufficient. Therefore I will take this task to extend
the manual and the FAQs for this case.
Please let me know if the usage of the callback parameter solved the problem.
Original comment by sven.strohschein@googlemail.com
on 5 Feb 2013 at 7:00
Attachments:
Yes, using a callback parameter in the addListener method solved the problem.
Thanks!
Original comment by jvz...@gmail.com
on 6 Feb 2013 at 8:45
Original issue reported on code.google.com by
jvz...@gmail.com
on 5 Feb 2013 at 1:32