Events blocked while loading page

Situation: I open one browser and load my web app. It takes about 10 seconds to load (normal behaviour as it needs to upload 2MB on picture/audio data to the browser. Once it is finished I open a new browser (same machine or other machine, does not matter) and this one starts loading.

Now the weird part. While browser 2 is loading, non of the events of browser 1 (clicking for example) are send to the web app! Only when the second browser has finished the loading, the first registers the events again. Is this normal?

Tested with both CGI and Standalone.

Is this 2MB a single file? or multiple files?

Actually one json-like object containing some base64 encoded parts. it’s send to the browser using an executeJavaScrip() command. It looks like while an executeJavaScript() function is running, the app does not execute other events received from a Xojo.triggerServerEvent() in the javascript even if it’s executed from another browser on another pc.

If that is the case that raises som problems for my app. Although for the preload I can change my assetloader to work in a different way (sending filenames instead of base64 data), the rest of the control heavely depends on rather large chucks of json-like data being passed between the Xojo exe and the browser.

[quote=135221:@Alain Bailleul]Actually one json-like object containing some base64 encoded parts. it’s send to the browser using an executeJavaScrip() command. It looks like while an executeJavaScript() function is running, the app does not execute other events received from a Xojo.triggerServerEvent() in the javascript even if it’s executed from another browser on another pc.

If that is the case that raises som problems for my app. Although for the preload I can change my assetloader to work in a different way (sending filenames instead of base64 data), the rest of the control heavely depends on rather large chucks of json-like data being passed between the Xojo exe and the browser.[/quote]

What about using a thread ?

[quote=135221:@Alain Bailleul]Actually one json-like object containing some base64 encoded parts. it’s send to the browser using an executeJavaScrip() command. It looks like while an executeJavaScript() function is running, the app does not execute other events received from a Xojo.triggerServerEvent() in the javascript even if it’s executed from another browser on another pc.

If that is the case that raises som problems for my app. Although for the preload I can change my assetloader to work in a different way (sending filenames instead of base64 data), the rest of the control heavely depends on rather large chucks of json-like data being passed between the Xojo exe and the browser.[/quote]
I suggest creating a WebFile and just sending the URL down to the browser for direct retrieval. Sending large chunks of data through the command stream will certainly make the whole app slower. It would be even better if you were not relying on the app itself for delivery. For instance, if you’re also running a web server like IIS or Apache on the server, have the large asset requests go there. They are much better tuned for things like that.

If the assets don’t change and are not private, I suggest putting them on a CDN.

Thanks for the suggestions @Greg O’Lone , but I think the thread suggestion of @Michel Bujardet seems to be the way I’ll go. Getting some very nice results with that :slight_smile:

I would’ve expected executeJavaScrip() was running in a thread by design, but you’ll have your reasons :slight_smile:

Yes, as this feature executes on the client side, it should be launched from the thread of the session. It’s very annoying if this is not the case.