Multiple slow rest calls on the page resulting slow rendering time

Multiple slow rest calls on the page resulting slow rendering time

  

Hi all, 

I'm testing here and I have 12 rest calls and those takes time from fast to  around 1000 ms each. I need to display result of from each at the page. This leads sometimes more than 10 seconds page rendering time. 

Logic:

Resulted page (contains also prosessing time from the rest call):


How to do this better?



Sampsa Sohlman wrote:

Hi all, 

I'm testing here and I have 12 rest calls and those takes time from fast to  around 1000 ms each. I need to display result of from each at the page. This leads sometimes more than 10 seconds page rendering time. 

Logic:

Resulted page (contains also prosessing time from the rest call):


How to do this better?



Those might be called Synchronously, If you want to be ready with Data of API for Screens than you can use DataActions for each.

DataActions gets called automatically & will be  called asynchronously i.e all of your API will be called once & your time will be less as compare to the Synchronous one.


Cheers,

Assif



Data actions are only for mobile.

https://success.outsystems.com/Documentation/10/Reference/Mobile_Interfaces/Adding_Data_and_Logic/Data_Action

What if I want to use these on server side? 

Maybe...just maybe you should combine those logic into 1 REST API. This way also harder to catch an exception.

To combining this to one rest API is not an option. I'm doing this as exercise and the simulated case comes from past career, where you might have to combine the results of the multiple web services to screen. I could basically write/use middle man process with some other technology that would combine these results on parallel calls. 

Basically the question is that can you do this on paraller?

Now I made this as OS 11 Service Action :) and nicely from monitoring ServiceActions of view you can see the slowness there too.



My conclusion here is that this is missing functionality on platform so I did submit new development idea for it.

https://www.outsystems.com/ideas/5505/support-for-non-blocking-io-operations-integrations-for-outsystems-platform

Async server actions is one of my most awaited feature on the platform - https://www.outsystems.com/ideas/2338/add-asynchronous-functionallity

You may make use of timers to get around it with the use of Session or Entities to maintain state.

John