Asynchronous Data Refresh in OutSystems

Asynchronous Data Refresh in OutSystems

I wanted to start by sharing the average attention span study

No alt text provided for this image

It has been a continuous challenge to every engineer to squeeze every little bit of logic to give information immediately. Engineers are coming up with different designs that don’t rely on a clock but rather fires up signals that indicate completion. This applies to both hardware and software which is where “asynchronous communication” comes in.

Asynchronous communication is transmission of data, generally without the use of an external clock signal, where data can be transmitted intermittently rather than in a steady stream. — Wikipedia

Modern browser supports this placing some limitations to protect from connection choke

No alt text provided for this image

https://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser

OutSystems takes advantage of this browser feature in Reactive and Mobile framework by having the Data source and Aggregates triggered in parallel when loading a page.

No alt text provided for this image
No alt text provided for this image

However, there will be times where we need to refresh them again and by using the usual way, we are only able to refresh synchronously

No alt text provided for this image
No alt text provided for this image

Notice the wait before DataAction2 gets to be triggered which means waiting time is compounded to 600~ msThis is fine if DataAction2 is dependent on the result of DataAction1. I find it sometimes that this is not the case and therefore could be improved by taking advantage of the browsers multiple connections.

The strategy is to wrap them to another client action

No alt text provided for this image
No alt text provided for this image

And call the wrappers on JavaScript

No alt text provided for this image
No alt text provided for this image

This ended up refreshing them at the same time and both requests ended in 300~ ms compared to 600~ ms using the usual way.

In applying this strategy, please make sure that the code dependencies have been reviewed and dev team is aware why such code exists because maintaining it is another story :)

To view or add a comment, sign in

Others also viewed

Explore content categories