How to run widget instances in parallel on a service portal page?

Swarup Roy
Kilo Expert

Hi,

I have developed a service portal page which has got 4 different widget instances and these widgets are fetching data from using webservice API (both REST and SOAP),

fetching data from different third party system. (say , 4 colour box pill on the page)

Now, if i drill-down their execution pattern then i see that the API calls made by the widget go in sequence and the first pill information is shown

only when all the API calls ends and fetches their respective data. This comes as a big blow from performance perspective, as the SOAP API calls generally takes

around 5-6 sec and in totality the page loading time increase to 15-17sec , which is not all acceptable.

I'am looking forward for a way to make all these calls go in parallel, so that respective pill data load time decreases and those who are still loading could show

some user interactive message saying it's current loading. This design makes the page more practical in use and overall loading time would definitely decrease.

However, i'am not sure how the widget instances on the page could be run in parallel or is there any other simpler design which could be adopted for a better performing page.

Any help, folks out there?

4 REPLIES 4

larstange
Mega Sage

Hi



I don't think you will be able to make them run in parallel. Javascript does not support multi-threading.



What you could do is design your widgets to load in two steps.



1. First the widget will load with a basic markup and maybe a "loading content" message and a rotating font awesome icon


2. In the client controller add a short delay and then trigger the server side script part to retrieve the information vi REST or SOAP. When the server response returns and your data model is filled, the content will be rendered in the widget.



This will make the page load very quickly and give the user the experience that your portal is responding quickly.



I have used this approach in a couple of widgets which take time to load their data server side.


Thanks Lars for your response and the workaround. The workaround is exactly what i have done right now , by putting a 'timeout'.


This will help to some extent but this will increase the loading time of that particular pill as it will be, 'timeout time' plus the 'individual api response time'.


So, if a user is interested in checking that particular pill then the user has to wait.


I have tried different timeout and it seems i have to put a significant timeout time of 3 sec, anything below that does not show the effect. I'am so desperate for a multi-threaded model now.


Can you elaborate how to actually do this short delay - hoping we can reuse this method on our existing custom widgets (some of which have glide queries that takes some time to finish) to show a "Loading content. Please wait." message instead of having the whole page load for a long time.

walid1
Kilo Explorer

hello

i think to make them run in parallel

Tutuapp 9Apps ShowBox