Server-push through Web-workers [message #1702645] |
Thu, 23 July 2015 17:25 |
Dmitry Pryadkin Messages: 146 Registered: July 2009 |
Senior Member |
|
|
I would like to describe my issue and tell about my workarounds to it. I hope it could be helpful to RAP developers if they consider my scenario.
I'm now missing old UICallback mechanism after upgrading from older RAP to 2.3 (haven't tried on 3.0 yet) .
I'm working on a Thin-client which is based on RAP. That means, there is a dedicated Server to which the RAP host connects and communicates with.
That Server tends to drive user sessions in a somewhat synchronous style. That is pushing events to the UI in realtime without a prior UI interaction.
The ServerPushSession from RAP is not suitable for that. ServerPushSession has to be either stopped explicitly or by some internal timeout. Until that the UIThread is stuck and thus no changes sent to the Browser, and serverpush request remains in pending state.
I found a quick and dirty workaround by sending empty requests to the RAP UI servelet from javascript side. This gives a spin to the UI thread so the UI changes can be sent to the Browser.
I guess the same can be coded on Java side. Something like starting a ServerPush session after each UI request and ending it after some reasonable timeout.
I'm also planning to bring Webworkers to optimize my above workaround.
|
|
|
Powered by
FUDForum. Page generated in 0.02656 seconds